Results 1 to 2 of 2
- 02-02-2009, 05:42 AM #1
Member
- Join Date
- Jan 2009
- Posts
- 8
- Rep Power
- 0
problem in retriving string data using jsp
my code is
ps=con.prepareStatement("SELECT * FROM LIBUCE WHERE BOOKID=?");
String bk=request.getParameter("t7");
ps.setString(4,bk);
rs=ps.executeQuery();
if(rs.next())
{
do
{
String nm=rs.getString(1);
int rl=rs.getInt(2);
String yr=rs.getString(3);
String br=rs.getString(4);
%>
while retriving ROLL which is an integer ,its working fine.
but in case of BOOKID which is a string data,i am getting error like
sql statement not ended properly.
plz help me how to do this with string.
Is there anything other than getParameter() for retreiving strings.
- 02-02-2009, 08:53 AM #2
Senior Member
- Join Date
- Dec 2008
- Location
- Hong Kong
- Posts
- 473
- Rep Power
- 5
why is 4 in ps.setString(4,bk);
Similar Threads
-
String Problem
By gnomewise in forum New To JavaReplies: 1Last Post: 10-19-2008, 12:37 PM -
Problem is getting the data to browser
By freddieMaize in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 05-26-2008, 02:49 PM -
problem with fetching data
By payal.mitra86 in forum JDBCReplies: 0Last Post: 05-24-2008, 01:29 PM -
Retriving image from database
By Java Tip in forum Java TipReplies: 0Last Post: 02-09-2008, 08:41 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks