3
Hello, I am doing a user/password verification in java and I need to perform a query in which check in the database there is a login and a password related to the typed in jTextFields
. But I’m not getting if anyone can help me I’m grateful, to help get a sense of what I need here’s an example :
sql= "SELECT * FROM login_sistema WHERE usuario_login =(aqui no caso ficaria a variavel do jTextField) AND senha_login =(aqui no caso ficaria a variável do jTextField) ";
However, I don’t know how to implement in the demarcated field the variable containing the value of textField
tried several ways but only resulted error.
See if you haven’t forgotten the "'". Your code should look like this: "SELECT * FROM login_sistema WHERE usuario_login ='(here in case would be the variable of jTextField)' AND login ='(here in case would be the variable of jTextField)'";
– Emir Marques
But for example, I added the jTextFields to a variable in this way [ String password_conf = jTextField2.gettext(); ] as I could include the variable password_conf in sql code ?
– Prostetnic Vogon Jeltz
Are you using jdbc? if you have the code that processes sql put as well
– rray
Yes, I am. 
 PreparedStatement ps;
 ps = connection.prepareStatement(sql);
 ps = (PreparedStatement) ps.executeQuery(sql); 
 ps.setString(1, login_login); 
 ps.setString(2, senha_senha);
– Prostetnic Vogon Jeltz
this is what I am putting after sql request
– Prostetnic Vogon Jeltz
I think we just missed the questions and post your code in question :P, part of it seems correct.
– rray