• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

callablestatement inserting record but returning false

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic