Java ODBC connection database demonstration code

From , 2 Years ago, written in Java, viewed 100 times.
URL https://pastebin.vip/view/9e9ed6d2
  1.  import java.sql.Connection;
  2.    
  3.     import java.sql.DriverManager;
  4.    
  5.     import java.sql.*;
  6.    
  7.     import javax.swing.JFrame;
  8.    
  9.     import javax.swing.JOptionPane;
  10.    
  11.     public class testcon extends JFrame{
  12.    
  13.     Connection con;
  14.    
  15.     public testcon(){
  16.    
  17.     try{
  18.    
  19.     con=DriverManager.getConnection"jdbc:odbc:JAVASQL","sa","abc123");
  20.    
  21.     JOptionPane.showMessageDialogthis.getContentPane(),"ok");
  22.    
  23.     }
  24.    
  25.     catchException e){
  26.    
  27.     e.printStackTrace();
  28.    
  29.     JOptionPane.showMessageDialogthis.getContentPane(),"error");
  30.    
  31.     }
  32.    
  33.     }
  34.    
  35.     public static void main(String[] args) {
  36.    
  37.     testcon aa=new testcon();
  38.    
  39.     }
  40.    
  41.     }
  42.    
  43.  
  44. //java/4484

Reply to "Java ODBC connection database demonstration code"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website