aspose file tools*
The moose likes JSP and the fly likes JDBC Error  (Missing Operator) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JDBC Error  (Missing Operator)" Watch "JDBC Error  (Missing Operator)" New topic
Author

JDBC Error (Missing Operator)

vikram nalagampalli
Ranch Hand

Joined: Oct 08, 2001
Posts: 91
Hi all,
I am using a select statement to compare userid and password. I am getting an error 'Missing Operator'. Can anyone tell me what the problem is plsssss
I am enclosing both the error code as well my jsp code.
Thankyou in advance
Location: /vikram/LoginHandler.jsp
Internal Servlet Error:
javax.servlet.ServletException: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'Email =vikrampn@yahoo.com AND Password=vikram'.
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:459)
at _0002fLoginHandler_0002ejspLoginHandler_jsp_1._jspService(_0002fLoginHandler_0002ejspLoginHandler_jsp_1.java:159)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.java:130)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:282)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at org.apache.tomcat.core.Handler.service(Handler.java:287)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
at java.lang.Thread.run(Thread.java:484)
Root cause:
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'Email =vikrampn@yahoo.com AND Password=vikram'.
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6031)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6188)
at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(JdbcOdbc.java:2494)
at sun.jdbc.odbc.JdbcOdbcStatement.execute(JdbcOdbcStatement.java:334)
at sun.jdbc.odbc.JdbcOdbcStatement.executeQuery(JdbcOdbcStatement.java:249)
at _0002fLoginHandler_0002ejspLoginHandler_jsp_1._jspService(_0002fLoginHandler_0002ejspLoginHandler_jsp_1.java:100)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.java:130)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:282)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at org.apache.tomcat.core.Handler.service(Handler.java:287)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
at java.lang.Thread.run(Thread.java:484)

ps:
Please use the opening and closing [ code ] tags (without the spaces). Also, disabled the smiles on this thread.
- madhav
[ April 29, 2002: Message edited by: Madhav Lakkapragada ]
Girish Jetty
Greenhorn

Joined: Apr 25, 2002
Posts: 4
Hi vikram
U need to put the userid and password within single quotes like below:
String st1="SELECT Ssn FROM Authentication WHERE Email='" +userId+"' AND Password='"+password+"'";
Good Luck!!
Bye
Girish
vikram nalagampalli
Ranch Hand

Joined: Oct 08, 2001
Posts: 91
Hi Mr. Madhav,
Can u tell me in detail, what u mean by close tags without space.

Thanks Girish, I tried that already, but no luck.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC Error (Missing Operator)