Hello all,
Am new here, so please bear with me - if i dont get some things right!
Okie Dokie. Lets get started.
I was working with Tomcat/Servlet/ODBC.
I created a table in MS Access. Created the Connection, Statement, query and everything. I want to retrieve the information from the table depending on the search criterion(like for ex.in the html page I send the Last Name, catch that in servlet, and then use that to get the required data from the table). Now here's my problem, when i write the following, the Tomcat container gives errors-saying "...Syntax Error(missing operator) in query expression 'Last name=mat'...".
ResultSet rs=st.executeQuery("Select * from Employees where Last Name="+request.getParameter("LastName"));//'st' is the Statement object.
I initially thought the problem was in catching the parameter(but it wasn't so,) 'cause i did the following, and i got the output in the container console.
String LastName=request.getParameter("LastName");
System.out.println(LastName);//'request' is the object of HttpServletRequest
ok, now since i got the Parameter read in my servlet from the html page, i tried the following;
ResultSet rs=st.executeQuery("Select * from Employees where Last Name="+LastName);
but again the result was no different from the earlier....
please help suggest what i can possibly do....
is there something i am missing?
thanx for reading,
Mat