is there any difference b/w connection of a simple java prog. and a servlet.

G

Garg

Hi All,

Can anny one help me.

I am trying to update the database by using a callable statement. But
in case of servlet i am getting an error
java.sql.SQLException: Not all parameters bound.

But if i call the same procedure with same data and every thing. it is
able to update the database.

I am not able to understand the difference between a simple java
program call and a servlet call.

Thanks
Tarun Garg
 
D

Daniel Pitts

Garg said:
Hi All,

Can anny one help me.

I am trying to update the database by using a callable statement. But
in case of servlet i am getting an error
java.sql.SQLException: Not all parameters bound.

But if i call the same procedure with same data and every thing. it is
able to update the database.

I am not able to understand the difference between a simple java
program call and a servlet call.

Thanks
Tarun Garg
I'm guessing that you're not Actually calling stored proc the same way
in both cases. Use a debugger, or logger, to verify that the exact
same SQL and parameters are passed through.
 
G

Garg

No.

I am coping and pasting the same code from the jave prog. to the
servlet. so there is no mismatch.

butmine understanding is java prog is run by a JVM and that handles all
the thing. but in case of servlet application server (tomcat i m using)
is handling all these things. So is there any difference between
'execute' of JVM and application server.

Or as i am using Cache as a database, that it self is not able to
handle this.

Tarun Garg
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Garg said:
I am coping and pasting the same code from the jave prog. to the
servlet. so there is no mismatch.

butmine understanding is java prog is run by a JVM and that handles all
the thing. but in case of servlet application server (tomcat i m using)
is handling all these things. So is there any difference between
'execute' of JVM and application server.

A standalone app and a servlet can differ in how the
connection is created. There should be no
difference in the execution of SQL statements.

Try and check:
- that JDBC driver version is the same
- that the parameters you set are actually the same

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top