aspose file tools*
The moose likes JDBC and the fly likes PreparedStatement Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "PreparedStatement Error" Watch "PreparedStatement Error" New topic
Author

PreparedStatement Error

karthik swamy
Ranch Hand

Joined: Mar 14, 2011
Posts: 42
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

Joined: Dec 28, 2007
Posts: 2266
    
    3

Champ, since this is more related to JDBC, I'm moving this to the JDBC forum.


Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3610
    
  60

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
Bartender

Joined: Oct 14, 2005
Posts: 18657
    
    8

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: PreparedStatement Error