JSP调用MySQL存储过程(带参数) - 代码发芽网
来源:百度文库 编辑:神马文学网 时间:2024/04/29 13:54:10
Java Server Page语言: JSP调用MySQL存储过程(带参数)<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%@ page import="beans.DBUtil" %>
<%@ page import="java.sql.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
My JSP 'Proc.jsp' starting page
<%
DBUtil db = new DBUtil();
Connection conn = db.getConnection();
CallableStatement cs = conn.prepareCall("{call P_setAgeBySno(?,?,?)}");
//set the input parameter
cs.setString("no","2");
cs.setInt(2,199);
//sert the output parameter
cs.registerOutParameter("name",Types.CHAR);
cs.execute();
String result = cs.getString(3);
out.print("Data from executing the procedure:
");
out.print(result);
if(cs != null)
cs.close();
if(conn != null)
conn.close();
%>
<%@ page import="beans.DBUtil" %>
<%@ page import="java.sql.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%
DBUtil db = new DBUtil();
Connection conn = db.getConnection();
CallableStatement cs = conn.prepareCall("{call P_setAgeBySno(?,?,?)}");
//set the input parameter
cs.setString("no","2");
cs.setInt(2,199);
//sert the output parameter
cs.registerOutParameter("name",Types.CHAR);
cs.execute();
String result = cs.getString(3);
out.print("Data from executing the procedure:
");
out.print(result);
if(cs != null)
cs.close();
if(conn != null)
conn.close();
%>
JSP调用MySQL存储过程(带参数) - 代码发芽网
Java调用存储过程
Mysql 存储过程
JDBC 驱动程序调用存储过程
mysql存储过程与函数
SQL Server的存储过程调用Com组件
VB实现SQL Server 2000存储过程调用
如何从 ASP 调用 SQL Server 存储过程
asp.net调用存储过程方法新解
Oracle存储过程中如何将表名作为参数?
Oracle官方示例---Java 存储过程示例代码区
存储过程
调用IE内置打印组件完成web打印方案及例程,jsp,asp,sql,php,mysql,server,apache,iis,tomcat,oracle,java,linux,dns
dojo远程过程调用
系统调用过程
存储过程中如何用表名作为输入参数?动态SQL语句的一些常见写法
Oracle存储过程学习
mysql安装过程
修改MYSQL数据库,数据表,字段的编码(解决JSP乱码)
配置TOMCAT ECLIPSE MYSQL的JSP环境
asp + oracle 分页方法 (不用存储过程)
INFORMIX IDS11.5 动态存储过程(DYNAMIC SPL) - INFORM...
vbscript事件过程的调用
MySQL的表类型和存储引擎