I believe u are using prepared statement...
so just say...
-----------------------------------------------
String userName="abc";
String password="def";
String login = "SELECT * FROM USERS WHERE UserName=? AND Password=?";
PreparedStatement pstmt = conn.prepareStatement(login);
pstmt.setString(1,userName);
pstmt.setString(2,password);
ResuletSet rs = pstmt.executeQuery();
-----------------------------------------------
PreparedStatement will take care of each and every special character
like " , ' etc...
Nishit
-----Original Message-----
From: sufi malak [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 27, 2001 11:05 AM
To: [EMAIL PROTECTED]
Subject: Off topic (MS Access query question) ?
I am using MS Access database.
I have an sql quesion please:
what's wrong with this query :
String login = "SELECT * FROM USERS WHERE UserName = '" + ? + "' AND
Password = '" + ? + "'";
When I complile the bean I got this error :
C:\tomcat4\webapps\ultra2\WEB-INF\classes>javac Employee.java
Employee.java:30: illegal start of expression
String login = "SELECT * FROM USERS WHERE UserName = '" + ? + "' AND
Password
= '" + ? + "'";
^
1 error
Thanks
Thanks
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets