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 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
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
 
Similar Threads
IBM 484 : Stmt.execute(Str) - multiple result sets?
Stored Procedure
resultset or prepared stmt?.
stored procedure
executeUpdate() returning unexpected results