調用存儲過程

public class DBPro
{
	public static void main(String[] args) throws Exception
	{
		Class.farName("com.ibm.db2.jcc.DB2Driver");
		Connection ct = DriverManager.getConnection("","","");
		
		CallableStatement cs = ct.prepareCall("call update_trans(?)");
		cs.registerOutParameter(1,java.sql.Types.INTEGER);//註冊輸出參數
		cs.execute();
		System.out.println(cs.getString(1));
		cs.close();
		ct.close();
	}
}
相關文章
相關標籤/搜索