Jump to content

connot check customer id in database...


liee
 Share

Recommended Posts

public void check() { String nama=name.getText(); String icnom=icno.getText(); String idnum=idno.getText(); String user = ""; String pass = ""; String url = "JDBC:ODBC:8cc"; String driver = "sun.jdbc.odbc.JdbcOdbcDriver"; try{ stmt=con.createStatement(); String query="Select * FROM customer WHERE idno=('"+idnum+"')"; ResultSet rs=stmt.executeQuery(query); if(rs.next()) { String dbpass=rs.getString(idnum); if(dbpass.equals("")) { JOptionPane.showMessageDialog(this, "you are members", "Success", JOptionPane.INFORMATION_MESSAGE); } else { JOptionPane.showMessageDialog(this, "you are not member", "Success", JOptionPane.QUESTION_MESSAGE); } } } catch(SQLException e) { System.out.println(e.getMessage()); } } *cannot check customer id in my database...why..??

Link to comment
Share on other sites

  • 2 weeks later...

That is not a Javascript question, but you should verify all of your variables as the first step, make sure they all have the correct values. Things like name, icno, and idno might not be set to what you think they are. A SQL error might also be going somewhere you don't expect, maybe print that message in the same place as the other dialogs.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...