Link to home
Start Free TrialLog in
Avatar of perrycn
perrycn

asked on

How Do I call an Oracle stored procedure with JSP?

I need to know how to call a stored procedure in a JSP page.   I am using Oracle 9i Release 2 (9.2.0.5.0) or Oracle 10g (10.1.0) database.  O.S. Windows 2000.  Please give me an example, a line of code, or a reference on how to do this.  If this is not possible then tell me that also.
Avatar of perrycn
perrycn

ASKER

Also I am using Apache web server installed with Oracle Application Server 10g and JDeveloper 10g as the development tool for creating the web pages.  
Avatar of perrycn

ASKER

These articles explain how to create an Oracle Stored Procedure and Java Stored Procedure.   How do I make the call in the JSP page?  Give an example.
exactly as you would in java...

Is the question that you want to know how to load the JDBC drivers, connect to an Oracle database, execute an sql query and parse the result set?
Avatar of perrycn

ASKER

OK this explains how to call a Sybase stored procedure in java.   So are you saying I need to call the stored procedure in a java bean and then call the javabean in the jsp page.   Is there a way to call the stored procedure from within the jsp page?   For example the code for calling a java bean is:

first you have:
<jsp:useBean class="abcd.view.ControlledDataItem"  id="cdi" scope="page" />

then where you make the call you have:
<%= cdi.getCDI(l_wholeword, l_schema) %>



ASKER CERTIFIED SOLUTION
Avatar of koppcha
koppcha
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of perrycn

ASKER

Ok, koppcha, this is what I was looking for.  I don't quite know what you mean when you say:  establish the connection Class.forName()
get the connection???       I will have to try this later since I have to work on something else right now.
This is the link that explains how to connect
http://www.cise.ufl.edu/class/cis4301fa04/Assignments%20Information%20and%20Database%20Systems%20I%20Fall%202004_files/example.html

You can keep the whole connect part and executing part inside the scriptlet in JSP
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of perrycn

ASKER

I finally got the the stored procedure call to work in a jsp page.  koppcha, I did it similar to your statements.  jim cakalic I did try it your way but could not get JDeveloper to include the tag library.  I tried many different ways.  I guess I would need to write another question.  But I at least got it work one way.  Both you gave good answers.  Thanks for your help.