my dog learned polymorphism*
The moose likes JDBC and the fly likes executeUpdate() return type problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "executeUpdate() return type problem" Watch "executeUpdate() return type problem" New topic
Author

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();

System.out.println(intRet);

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
Greenhorn

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: http://aspose.com/file-tools
 
subject: executeUpdate() return type problem