AF
HomeTagSubmit NotesAsk AnythingLoginSubscribe Us
AF
1. Feel Free to ask and submit anything on Anyforum.in and get satisfactory answer
2. Registration is not compulsory, you can directly login via google or facebook
3. Our Experts are looking for yours ?.



java-sql: Incorrect syntax near the keyword User

import java.sql.*;
import form.ConnectionProvider;
public class LoginDao {
public static boolean validate(LoginBean bean){
boolean status = false;
try{
PreparedStatement ps=ConnectionProvider.getCon().prepareStatement(
"SELECT* FROM user where email=? and pass=?");

ps.setString(1,bean.getEmail());
ps.setString(2,bean.getPass());

ResultSet rs=ps.executeQuery();
System.out.println("No Exception");
status=rs.next();
}catch (Exception e){
System.out.println(e.getMessage());
e.getStackTrace();
}
return status;
}}

when i debug, i got the result="INFO: Reloading Context with name [/zeal] is completed
Incorrect syntax near the keyword ´user´.
false

please solve anyone this issue "thanks in advance"

java x 210
sql x 47
Posted On : 2016-08-09 18:21:50.0
profile MOHAMMAD SALEEM BASHA - anyforum.in MOHAMMAD SALEEM BASHA
267150
up-rate
4
down-rate

Answers


User is a reserved keyword, so you need to use square brackets to make it explicit that you mean the object named "User" it, i.e. use [User] instead of User.

Posted On : 2016-08-09 21:18:58
Satisfied : 1 Yes  0 No
profile Rishi Kumar - anyforum.in Rishi Kumar
523188222695
Reply This Thread
up-rate
3
down-rate



Post Answer
Please Login First to Post Answer: Login login with facebook - anyforum.in