import java.sql.Connection; import java.sql.DriverManager; import java.sql.*; import javax.swing.JFrame; import javax.swing.JOptionPane; public class testcon extends JFrame{ Connection con; public testcon(){ try{ con=DriverManager.getConnection("jdbc:odbc:JAVASQL","sa","abc123"); JOptionPane.showMessageDialog(this.getContentPane(),"ok"); } catch (Exception e){ e.printStackTrace(); JOptionPane.showMessageDialog(this.getContentPane(),"error"); } } public static void main(String[] args) { testcon aa=new testcon(); } } //java/4484