File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes prepared statement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Reply locked New topic
Author

prepared statement

rakhi sinha
Ranch Hand

Joined: Mar 26, 2012
Posts: 147
i am using following code .....values are coming from first servlet......if command is not working all prepared statement are running......


E Armitage
Rancher

Joined: Mar 17, 2012
Posts: 892
    
    9
rakhi sinha wrote:i am using following code .....values are coming from first servlet......if command is not working all prepared statement are running......

What is the problem again?
If your code doesn't enter any of the if blocs then print out the values of all those parameters to confirm that they are (not) null.
rakhi sinha
Ranch Hand

Joined: Mar 26, 2012
Posts: 147
E Armitage wrote:
rakhi sinha wrote:i am using following code .....values are coming from first servlet......if command is not working all prepared statement are running......

What is the problem again?
If your code doesn't enter any of the if blocs then print out the values of all those parameters to confirm that they are (not) null.


my problem is that i want to execute pst2 and pst3 only when values of m2 and m3 are not null but it is executing always,........
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1449
    
    6

try this



Swastik
rakhi sinha
Ranch Hand

Joined: Mar 26, 2012
Posts: 147
Swastik Dey wrote:try this



thanks fro your suggestion but it is giving same output .. it is not working
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1107

As you have started another thread presuming this one also solved
 
wood burning stoves
 
subject: prepared statement
 
Similar Threads
How to configure Bonecp in java project without breaking connection when more than connection
how to update data of a field in one table from other table using jsp or java?
insertion of values
prepared statement in for loop
doubt regarding default values