hi,
I hope this helps u out.
The code snippet below shows a call to an oracle stored procedure. Note the
difference in how the IN and OUT parameters are specified, and also how the
OUT parameters are retrieved. Modify it to suit ur requirments. But make
sure the stored procedure is already "stored" on the database. I assume
connection "con" is already established.
try {
cs = con.prepareCall(
"call my_oracle_procedure(?,?,?,?,?,?,?,?)");
cs.setString(1, companyName);
cs.setString(2, address);
cs.setString(3, cityName);
cs.setString(4, stateName);
cs.setString(5, zipCode);
cs.setString(6, phoneNumber);
cs.registerOutParameter(7, Types.DOUBLE);
cs.registerOutParameter(8, Types.DOUBLE);
cs.executeUpdate();
latitude=Double.parseDouble(cs.getString(7));
longitude=Double.parseDouble(cs.getString(8));
} catch (Exception e) {
e.printStackTrace();
}
Sajan Thomas.
----- Original Message -----
From: Amit Bansal <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 06, 2000 12:23 PM
Subject: stored procedures - servelet
> Hi servlets champions,
> Can any one tell me how to execute
stored
> procedure in Java. I have a built in stored procedure in sql-anywhere and
I
> want to run it.
>
> PLEASE REPLY ASAP
> AMIT
>
>
___________________________________________________________________________
> 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
___________________________________________________________________________
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