File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes executeUpdate() return type problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "executeUpdate() return type problem" Watch "executeUpdate() return type problem" New topic

executeUpdate() return type problem

Vaibhav Goel
Ranch Hand

Joined: Jul 05, 2007
Posts: 40
Hello friends,

I got -1 as return type of CallableStatement query.

When i write the following:-

CallableStatement callStmt = CallableStatement.prepareCall(My call to procedure);
int intRet = callStmt.executeUpdate();


Please tell me why return type of executeUpdate() could be -1?
Paul Campbell
Ranch Hand

Joined: Oct 06, 2007
Posts: 338
you have a SQL error that you are not catching
sajja bala

Joined: Dec 12, 2007
Posts: 11
Hello Vibhav,

I think the executeUpdate() will return either zero or other integer value.
You say that you have got -1; then it indicates the the row count for the INSERT or UPDATE or DELETE statement

Have a Good Day........<br />Sajj Bala Subrahmanyam
I agree. Here's the link:
subject: executeUpdate() return type problem
It's not a secret anymore!