H1,
I am trying to use the following code, in my servlet.
The code creates a simple Stored Procedure and executes it. I am using
Oracle 7.2.3 and Apache JServ.
The motive here is to learn how to use 'Stored Procedures' using JDBC in
Servlets.
The code compiles without error, but it fails to actually add a record
to the database.
What could be the reason??
Any help is highly appreciated!
TIA
Gaurav
(Table name is MY_TABLE, with 4 field viz Name, Age, Sex, Address)
try {
String createProcedure = "create or replace procedure ADD_RECORD
" +
"as " +
"begin " +
"INSERT INTO MY_TABLE (Name, Age, Sex, Address) VALUES
(`George`, `32`, `M`, `San Francisco`)" +
"end ";
Statement stmt = con.createStatement ();
stmt.executeUpdate(createProcedure);
CallableStatement cs = con.prepareCall("{call ADD_RECORD}");
stmt.close();
con.close();
}
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html