6. Class.forName("com.mysql.jdbc.Driver");
cn = DriverManager.getConnection("jdbc:mysql://localhost/try", "root", "checkmate");
s = cn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
System.out.println("connected");
JOptionPane.showMessageDialog(jf,"!!!...WELCOME CHECKMATE(96)... !!!n ...YOUR DATABASE
CONNECTION IS ESTABLISHED....n ...YOU CAN ABLE NAVIGATE AND MANAGE ALL DATA OF YOUR CUSTOMERS
NOW...");
viewcheckmatedata();
} catch (SQLException e) {
System.out.println("sorry!!! some problems are occured in connectionn see details " + e);
} catch (ClassNotFoundException ce) {
System.out.println("class not found see detailsn " + ce);
} catch (Exception e) {
System.out.println("some problems are found see detailsn " + e);
}
}
void viewcheckmatedata()
{
try
{
rs=s.executeQuery("select * from cust");
rs.next();
nm.setText(rs.getString(1));
radd.setText(rs.getString(2));
cnt.setText(rs.getString(3));
badd.setText(rs.getString(4));
bcnt.setText(rs.getString(5));
fx.setText(rs.getString(6));
14. System.out.println("sqlexception check your sqlstatement see detail n " + e);
}
catch(NullPointerException ne)
{
System.out.println("null object referenses are set see detail n " + ne);
}
catch(Exception e)
{
System.out.println("some problems are found see detailsn " + e);
return;
}
}
public static void main(String[] args)
{
// TODO code application logic here
retaildetail r=new retaildetail();
r.connection();
JFrame jf=new JFrame("..........CheckMate(96)............");
jf.setContentPane(r);
jf.setVisible(true);
jf.setSize(300,600);
jf.setResizable(false);
}
}
END OF CODING