Release Date: 2002-04-05 Author: yanchang (simple-minded) people read: The following example 15748 switched 9cbs forum: * insert statement and execute a transfer parameter * / create or replace procedure p_test2 (i in number) asbegininsert into t values (i, 'x' || to_Char (i)); commit; end; / <% @ page language = "java" contenttype = "text / html; charSet = GB2312"%> <% @ page import = "Java. SQL. * "%>
| AAA TD> | BBB TD> TD> <% String Driver = Oracle.jdbc.driver. ORACLEDRIVER "; string strurl =" JDBC: Oracle: Thin: @ 192.168.1.6: 1521: db "; class.forname (driver); connection conn = drivermanager.getConnection (Strull," Scott "," Tiger "); String Procedure = "{call p_test2 (?)}"; CallableStatement cstmt = conn.prepareCall (procedure); cstmt.setInt (1,33); cstmt.executeUpdate (); Statement stmt = conn.createStatement (); ResultSet rs = stmt. ExecuteQuery ("Select * from T"); while (rs.next ()) {out.println (" | " rs.getstring (1) td> | " RS .getstring (2) " td> tr>");} r r.close (); stmt.close (); conn.close ();%> table> <% OUT. PRINT n.isclosed ());%> body> html> body> html>
转载请注明原文地址:https://www.9cbs.com/read-106587.html
|