• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

PreparedStatement Error

 
karthik swamy
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello everyone,
just view this SQL queryi.e
This is what i am getting from database :

then in jsp I am replacing like this :

then the query looks like this :

then i am binding it with prepareStatement

if i need to set String only for org_id then it works

but if then query comes like this:

then code the java code fails to work...

so please suggest me any solutions for this...



Thanks and regards,
Karthik Swamy
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Champ, since this is more related to JDBC, I'm moving this to the JDBC forum.
 
Martin Vajsar
Sheriff
Pie
Posts: 3751
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Karthik, please TellTheDetails (see especially ItDoesntWorkIsUseless).

Post the exception you're experiencing, including stack trace. Or, if you're not getting an exception, describe the output the code generates and explain why is it wrong.
 
Paul Clapham
Sheriff
Pie
Posts: 20746
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In that code with the cryptically-named variables "a" and "b", the value of "b" is always zero. Since you made it a variable, perhaps that wasn't what you intended.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic