<%
@page contentType
=
"
text/html;charset=gb2312
"
language
=
"
java
"
import
=
"
d7ith.*
"
%>
<
jsp:usejBean id
=
"
DataConn
"
scope
=
"
page
"
class
=
"
d7ith.DataConn
"
/>
<%
@page
import
=
"
java.sql.*
"
%>
<%
String oracleDriver
=
"
oracle.jdbc.driver.OracleDriver
"
;
String oracleUrl
=
"
jdbc:oracle:thin:@10.119.40.94:1521:d7i
"
;
String username
=
"
system
"
;
String password
=
"
d7i
"
;
Connection conn
=
null
;
ResultSet rs
=
null
;
try
{
Class.forName(oracleDriver);
conn
=
DriverManager.getConnection(oracleUrl,username,password);
}
catch
(ClassNotFoundException ex)
{
out.print(
"
装载驱动程序错误
"
);
}
catch
(SQLException ex)
{
out.print(
"
不能够连接数据库
"
);
}
String sql
=
"
{call R5.o7chkpsd(?,?,?)}
"
;
CallableStatement stmt
=
conn.prepareCall(sql);
stmt.setString(
1
,
"
R5
"
);
//
输入参数
stmt.setString(
2
,
"
111111
"
);
stmt.registerOutParameter(
3
,Types.CHAR);
//
输出参数为结果集参数
stmt.executeQuery();
String str
=
stmt.getString(
3
);
out.println(
"
第二个参数为:
"
+
str);
%>