Y yueer Unregistered / Unconfirmed GUEST, unregistred user! 2003-05-15 #2 到google下搜索一下,有很多相关文章的,给你贴几个: http://class.gzrail.net/read.php?classid=140 http://www.itraining.net.cn/lzh/showArticle.asp?art_ID=546 http://www.huihoo.com/java/oracle/oracle8i_java.html
到google下搜索一下,有很多相关文章的,给你贴几个: http://class.gzrail.net/read.php?classid=140 http://www.itraining.net.cn/lzh/showArticle.asp?art_ID=546 http://www.huihoo.com/java/oracle/oracle8i_java.html
M matian1978 Unregistered / Unconfirmed GUEST, unregistred user! 2003-05-16 #3 <h2>调用存储过程</h2> <% Class.forName("oracle.jdbc.driver.OracleDriver").newInstance(); String url="jdbcracle:thinlocalhost:1521:数据库"; String user="system"; String password="ss"; Connection Conn = DriverManager.getConnection(url,login,password); CallableStatement Prepare = Conn.prepareCall("exec p_test"); Prepare.executeQuery(); ResultSet rs = Prepare.getResultSet(); while(rs.next()) { out.println(rs.getString(1) ); } rs.close(); Conn.close(); %>
<h2>调用存储过程</h2> <% Class.forName("oracle.jdbc.driver.OracleDriver").newInstance(); String url="jdbcracle:thinlocalhost:1521:数据库"; String user="system"; String password="ss"; Connection Conn = DriverManager.getConnection(url,login,password); CallableStatement Prepare = Conn.prepareCall("exec p_test"); Prepare.executeQuery(); ResultSet rs = Prepare.getResultSet(); while(rs.next()) { out.println(rs.getString(1) ); } rs.close(); Conn.close(); %>
C clever_boy_2000 Unregistered / Unconfirmed GUEST, unregistred user! 2003-05-23 #4 gz.......................
Y yelogic Unregistered / Unconfirmed GUEST, unregistred user! 2003-06-05 #5 <h2>调用函数</h2> <% Class.forName("oracle.jdbc.driver.OracleDriver").newInstance(); String url="jdbcracle:thinlocalhost:1521:数据库"; String user="system"; String password="ss"; Connection Conn = DriverManager.getConnection(url,login,password); CallableStatement cs = Conn.prepareCall("begin ? := func(?,?); end; "); cs.registerOutParameter(1, Types.INTEGER); cs.setString(2, "param1"); cs.setString(3, "param2"); cs.execute(); int result = cs.getInt(1); cs.close(); Conn.close(); %>
<h2>调用函数</h2> <% Class.forName("oracle.jdbc.driver.OracleDriver").newInstance(); String url="jdbcracle:thinlocalhost:1521:数据库"; String user="system"; String password="ss"; Connection Conn = DriverManager.getConnection(url,login,password); CallableStatement cs = Conn.prepareCall("begin ? := func(?,?); end; "); cs.registerOutParameter(1, Types.INTEGER); cs.setString(2, "param1"); cs.setString(3, "param2"); cs.execute(); int result = cs.getInt(1); cs.close(); Conn.close(); %>
W wqhatnet Unregistered / Unconfirmed GUEST, unregistred user! 2004-03-18 #7 参考 http://www.java-cn.com