Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

execute Oracle SP's

Status
Not open for further replies.

ccampbell

Programmer
Aug 16, 2001
201
US
I need to connect to an oracle database and execute 10 different stored procedures. Does anyone have a snippet of code that works good in Java for executing Oracle Stored Procedures? Or would anyone recommend another way to accomplish this? Right now I am executing Java code to import XML files into an Oracle database and then I am trying to execute .NET code to run the procedures. I would like to combine both processes to simplify things. Thanks in advance
 
Use a CallableStatement object, created from the Connection.prepareCall() method.

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
This is an example that I use to validate that the zip code, city, state are correct.

/* call the store procedure */
CallableStatement cs = con.prepareCall("{call validateZipCode(?, ?, ?, ?, ?)}");
cs.setString(1, city.toLowerCase());
cs.setString(2, region.toLowerCase());
cs.setString(3, country.toLowerCase());
cs.setString(4, newZip);
cs.registerOutParameter(5, Types.VARCHAR);
cs.execute(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top