How do you call stored procedures from JSP

Showing Answers 1 - 11 of 11 Answers

Natarajan

  • Jun 30th, 2005
 

Using Callable Statement.

  Was this answer useful?  Yes

phani

  • Jul 11th, 2005
 

By using callable statement we can call stored procedures and functions from the database.

  Was this answer useful?  Yes

Rahul Pundhir

  • Jul 14th, 2005
 

Thanks for giving me the Guidence

  Was this answer useful?  Yes

shalabh

  • Aug 8th, 2005
 

how to create bean and use themthrough jsp, plz give me with one example

  Was this answer useful?  Yes

sasi

  • Aug 15th, 2005
 

Hai 
u can bean like a simple java prg.and compile it to create the class file.then using the jsp:useBean attribute u can connect the Bean.

  Was this answer useful?  Yes

sekhar

  • Sep 12th, 2005
 

we can call the stored procedures from jsp by using scriptlet tab.write the jdbc code in between this tag.

  Was this answer useful?  Yes

vadivel

  • Oct 5th, 2005
 

sasi Wrote:Hai
u can bean like a simple java prg.and compile it to create the class file.then using the jsp:useBean attribute u can connect the Bean.

  Was this answer useful?  Yes

haijitu

  • Jan 26th, 2011
 

<%@ taglib uri="java2s.com.tags" prefix="cbck" %>
<html>
<head><title>Calling a Stored procedure</title></head>
<body>
<h2>This JSP calls a stored procedure with a JSP 2.0 function</h2>

${cbck:addEvent("Event Name","place","16-Jul-2005")}

</body>
</html>

  Was this answer useful?  Yes

delindia

  • Jan 2nd, 2012
 

We can call stored producedure using sql tags in jstl


Code
  1. span style="color: #0000ff;">"myDataSource""jdbc/myjndiref"/>

  2. <sql:query var="examples""${myDataSource}">

  3.     exec ExampleProcLoadExample ?

  4.     <sql:param value="${exampleId}"/>

  5. </sql:query>

  6. <c:choose>

  7.     <c:when test="${fn:length(examples.rows) == 0}""example" value="${examples.rows[0]}""myDataSource""jdbc/myjndiref"/>

  8. <sql:update var="updateCount""${myDataSource}">

  9.     exec ExampleProcRemoveExample ?

  10.     <sql:param value="${exampleId}"/>

  11. </sql:update>

  12. <c:choose>

  13.     <c:when test="${updateCount le 0}">

  14.         <%-- no rows updated ! --%>

  15.     </c:when>

  16.     <c:otherwise>

  17.         <%-- some row(s) has been updated --%>

  18.         <c:out value="${updateCount} row(s) have been updated"/>

  19.     </c:otherwise>

  20. </c:choose>

  21.  

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions