I have a problem with this query :
insert into PLAYER(PSEUDO, EMAIL, PASSWORD) values("Test","[email protected]",md5('pass'));
It works on phpMyAdmin, but in Eclipse it goes in the catch...
Can you tell me why ?
EDIT:
// Si un textfield n'est pas renseignŽ (length=0), on affiche un
// MessageDialgo...Sinon, on proc�de ˆ l'inscription (insert...)
if (tfRegisterPseudo.getText().length() == 0
|| tfRegisterEmail.getText().length() == 0
|| tfRegisterPassword.getPassword().length == 0)
JOptionPane.showMessageDialog(null,
"You forgot something...");
else {
query = "insert into PLAYER(PSEUDO, EMAIL, PASSWORD) "
+ "values(\"" + tfRegisterPseudo.getText()
+ "\",\"" + tfRegisterEmail.getText()
+ "\",md5('" + String.valueOf(tfRegisterPassword.getPassword()) + "'));";
transmission.executeUpdate(query);
JOptionPane.showMessageDialog(null,"Successfully registered !");
}
setContentPane(buildLogin());
this.setVisible(true);
} catch (Exception m) {
// TODO Recuperer l'erreur de la BD et l'afficher
System.out.println("An error occured.");
JOptionPane.showMessageDialog(null,"An error occured.");
System.out.println(query);
}
}