• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JavaDB: Questions about Procedures

 
Timothy Frey
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm working on a problem involving a JavaDB database and I wanted to try a Stored Procedure solution. However, after reading all the JavaDB material I can get my hands on, it appears that "Stored Procedures" as I know them are not supported. Is this correct?

The JavaDB reference manual explains how to create "Procedures" which basically seem to point right back to Java code. Right now, I have a procedure called Add_Record which is supposed to insert a record if its new or update an existing record if the key already exists. The Procedure itself involves 2 more DB calls (1 SELECT, 1 INSERT/UPDATE).

What is the point of using a Procedure over just calling this Java method myself. It looks like it's just an extra step of indirection with nothing to show for it. Anyone have anything to share on the topic? Thanks.

[ May 14, 2008: Message edited by: Timothy Frey ]
[ May 14, 2008: Message edited by: Timothy Frey ]
 
Chad Naber
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look into the CallableStatement object in java.sql.*. This allows you to execute stored procedures in this fashion:

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic