• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

executeUpdate() return type problem

 
Vaibhav Goel
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 338
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you have a SQL error that you are not catching
 
sajja bala
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic