• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

callablestatement inserting record but returning false

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am entering student information in an html/jsp form which is invoking the servlet. I find the records inserted into database. However, after executeUpdate(), control is going to catch block. When I tried placing execute()/executeUpdate() in if else block, , control is going to else block but the record is being inserted successfully. Why is the execute() not returning a successful value?
 
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes .. This is the actual behavior

Check the Spec.

http://java.sun.com/javame/reference/apis/jsr169/java/sql/CallableStatement.html
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, Meetgaurav U R rite..

Michael,
Please read the API documentation and look for the execute method. That will explain it all to you.

http://java.sun.com/javase/6/docs/api/java/sql/CallableStatement.html :thumb:
 
michael tall
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After the statement is executed, it should naturally go to the very next statement. Instead it jumped even when there was no test condition.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!