I\'m currently writing a Java Swing application that reads data in from a MYOB database file and displays certain information in a table. I\'ve been able to successfully gen
Class.forName("com.mysql.jdbc.Driver");
connection=DriverManager.getConnection("jdbc:mysql://localhost:3306/hospitall","root","");
PreparedStatement ps=connection.prepareStatement("select * from patient where patientid='"+txtpatientid.getText()+"'");
Statement stm=connection.createStatement();
ResultSet rs=ps.executeQuery();
if(rs.next()){
String patientid=txtpatientid.getText();
String str="select * from patient where patientid='"+patientid+"'";
ResultSet result=stm.executeQuery(str);