?? callablestatementtest.java
字號:
/* * CallableStatementTest.java * * Created on June 10, 2005, 9:56 AM * * To change this template, choose Tools | Options and locate the template under * the Source Creation and Management node. Right-click the template and choose * Open. You can then make changes to the template in the Source Editor. */package ch01;import java.sql.*;import javax.sql.*;import common.*;/** * * @author kevin */public class CallableStatementTest { /** Creates a new instance of CallableStatementTest */ public CallableStatementTest() { } public static void main(String[] args){ Connection conn = null; CallableStatement cstmt = null; try{ ConnectionFactory factory = ConnectionFactory.getConnectionFactory(); conn = factory.getConnection(); cstmt = conn.prepareCall("{call ? := update_worker_salary_func(?, ?)}"); cstmt.setLong(2, 100); cstmt.setDouble(3, 0.8); cstmt.registerOutParameter(1, java.sql.Types.INTEGER); cstmt.execute(); int number = cstmt.getInt(1); System.out.println("number : " + number); }catch(Exception e){ e.printStackTrace(); } }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -