Im trying to make an login code. The quick explanation is that i want to show the details of the account in a deatils page but i cant do that because an error always show that the function is not implemented in the JDBC Driver
JButton btnLogin = new JButton("Login");
btnLogin.addActionListener(new ActionListener() {
@SuppressWarnings("deprecation")
public void actionPerformed(ActionEvent arg0) {
String query = "select Username,Password from Login where Username=? and Password=?";
try{
PreparedStatement pst = connDB.prepareStatement(query);
pst.setString(1,textFieldUN.getText());
pst.setString(2, passwordField.getText());
ResultSet rs = pst.executeQuery();
int count= 0;
while(rs.next()){
count++;
}
if(count == 1){
JOptionPane.showMessageDialog(null, "Signed In");
frame.dispose();
Details details = new Details();
details.setVisible(true);
String qwerty = " insert into LoginTemp select * from Login where Username = ? ";
PreparedStatement psts = connDB.prepareStatement(qwerty);
psts.setString(1, textFieldUN.getText());
psts.executeQuery(qwerty);
}else{
JOptionPane.showMessageDialog(null, "Incorrect Username and Password Try again");
}
rs.close();
pst.close();
}catch(Exception e){
JOptionPane.showMessageDialog(null, e);
}
}
});