java call Oracle procedure 获取返回值
2014-06-10 00:00
405 查看
public void printApplyProc(String p_gv_no, String p_print_type) {
// TODO Auto-generated method stub
String sql = null;
final String pgvno = p_gv_no;
final String pprinttype = p_print_type;
sql = "{CALL E_SHOP_UTIL.PRINT_APPLY(?, ?,?,?)}";//后两个是out put 参数
log.debug("printApplyProc instance");
try {
jdbcTemplate.execute(sql, new CallableStatementCallback() {
public Object doInCallableStatement(CallableStatement cs)
throws SQLException {
cs.setString(1, pgvno);
cs.setString(2, pprinttype);
cs.registerOutParameter(3, Types.VARCHAR);
cs.registerOutParameter(4, Types.VARCHAR);
cs.execute();
return new Integer(cs.getString(3));
}
});
log.debug("printApplyProc successful");
} catch (RuntimeException re) {
log.error("printApplyProc failed", re);
re.printStackTrace();
throw re;
}
}
// TODO Auto-generated method stub
String sql = null;
final String pgvno = p_gv_no;
final String pprinttype = p_print_type;
sql = "{CALL E_SHOP_UTIL.PRINT_APPLY(?, ?,?,?)}";//后两个是out put 参数
log.debug("printApplyProc instance");
try {
jdbcTemplate.execute(sql, new CallableStatementCallback() {
public Object doInCallableStatement(CallableStatement cs)
throws SQLException {
cs.setString(1, pgvno);
cs.setString(2, pprinttype);
cs.registerOutParameter(3, Types.VARCHAR);
cs.registerOutParameter(4, Types.VARCHAR);
cs.execute();
return new Integer(cs.getString(3));
}
});
log.debug("printApplyProc successful");
} catch (RuntimeException re) {
log.error("printApplyProc failed", re);
re.printStackTrace();
throw re;
}
}
相关文章推荐
- java程序调用Oracle 存储过程 获取返回值(无返回,非结果集,结果集)
- Oracle Procedure (PL/SQL) 实践归纳(3)之在Java利用Procedure获取结果集
- 在DWR中实现直接获取一个JAVA类的返回值
- 传参数无返回值的 java 调oracle的存储过程.(向数据库表中插入数据)
- 解决java获取oracle数据库值时丢失小数点前面的0
- java call oracle procudure setBoolean问题PLS-00306: wrong number or types of arguments in call to
- java oracle 存储过程(有返回值)返回列表--》学习二(转载+修改)
- c#中使用call调用oracle存储过程并获取out参数值
- IBATIS调用oracle存储过程——获取返回值
- java 中调用window系统中的文件,或者执行命令(shell、.CMD、.EXE)并获取返回值(如果有的话)
- Java 获取Oracle ROWID
- How to call Oracle function or stored procedure using spring persistence framework?
- java调用ORACLE 存储过程返回值
- 在DWR中实现直接获取一个JAVA类的返回值的两种方法
- 在DWR中实现直接获取一个JAVA类的返回值的两种方法
- java获取oracle中CLOB字段,转换成String
- 在DWR中实现直接获取一个JAVA类的返回值
- C# Call Oracle Procedure Demo(paras Query)
- Java Stored Procedure in Oracle
- java多线程编程获取线程返回值:ExecutorCompletionService