Some examples of the Oracle stored procedure in JSP

xiaoxiao2021-03-06  62

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 BBB <% 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) " RS .getstring (2) " ");} r r.close (); stmt.close (); conn.close ();%>

<% OUT. PRINT n.isclosed ());%>

转载请注明原文地址:https://www.9cbs.com/read-106587.html

New Post(0)
CopyRight © 2020 All Rights Reserved
Processed: 0.042, SQL: 9