Examples of simultaneous application of "stored Procedures" and "JavaBean" in the JSP

Source: Internet
Author: User
Application of stored procedure and JavaBean in js| stored procedure

Stored Procedure sp_shop_base:
Create Procedure sp_shop_base (@shop_id int, @msg char output)
As
SELECT Shop_name, Shop_phone, Shop_email, Shop_cash, shop_address
From Shop_shop
WHERE shop_id = @shop_id
SELECT @msg = ' retrieval finished '
Return 1

Program:
<%@ page contenttype= "text/html;charset=gb2312"%>

<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<title>jsp stored Procedures-Javabean-jdbc-odbc-sql Server </title>
<body>
<%@ page language= "java" import= "java.sql.*"%>
<jsp:usebean id= "BKA" scope= "page" class= "Shop.bka"/>
<%
ResultSet RS = Bka.executequery ("{Call Sp_shop_base (' 2 ', ')}");
while (Rs.next ()) {
Out.println (rs.getstring (1));
Out.println (rs.getstring (2));
Out.println (Rs.getstring (3));
Out.println (Rs.getstring (4));
Out.println (Rs.getstring (5));
}
Rs.close ();
%>



__________________________________________________


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.