关于java调用oracle返回结果集的存储过程问题 修正一下:toesUp.registerOutParameter(1,Types.JAVA_OBJECT);该句中各种Types我都一一试了一遍,1全部无效,只有在使用 REF 类型时,报2006冲突错误. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 static void sendEarlyDeaths(PrintWriter out) { Connection con = null; CallableStatement toesUp = null; try { con = ConnectionPool.getConnection(); // PostgreSQL needs a transaction to do this... con.setAutoCommit(false); // Setup the call. CallableStatement toesUp = connection.prepareCall("{ ? = call proc_int() }"); toesUp.registerOutParameter(1, Types.OTHER); getResults.execute(); ResultSet rs = (ResultSet) getResults.getObject(1); while (rs.next()) { String name = rs.getString(1); int age = rs.getInt(2); out.println(name + " was " + age + " years old."); } rs.close(); } catch (SQLException e) { // We should protect these calls. toesUp.close(); con.close(); }} 这段代码很常见,我也是在这段代码上修改的。不过,这段代码明显有错。例如:getResults.execute();我不知道去哪里得到这个方法。 ^_^ ResultSet rs = (ResultSet) getResults.getObject(1);这句好像有问题吧,一般返回应该是用getCursor方法的 火狐下点击页面跳转报超时 spring架构,如何设置session? 数据插入问题 急 在dwr中如何把回调的返回值String[]变量赋给javaScript变量 mysql数据库里的中文信息取到jsp页面显示为‘??’,怎么办? 这个问题有难度!!!!! 我想交朋友 急急急急!求解决!客户评论无刷新分页 求高手指点7张表的联合查询,都发了2天了,没人来么,高手哪里去了 求助!使用CURL模拟POST,DWR报failed to read input 急,请问如何将oracle的lib中的zip文件转换成jar文件?? 小弟初来,提一个问题,请大侠指教
Connection con = null;
CallableStatement toesUp = null;
try {
con = ConnectionPool.getConnection();
// PostgreSQL needs a transaction to do this...
con.setAutoCommit(false);
// Setup the call.
CallableStatement toesUp =
connection.prepareCall("{ ? = call proc_int() }");
toesUp.registerOutParameter(1, Types.OTHER);
getResults.execute();
ResultSet rs = (ResultSet) getResults.getObject(1);
while (rs.next()) {
String name = rs.getString(1);
int age = rs.getInt(2);
out.println(name + " was " + age + " years old.");
}
rs.close();
} catch (SQLException e) {
// We should protect these calls.
toesUp.close();
con.close();
}
}
不过,这段代码明显有错。
例如:getResults.execute();
我不知道去哪里得到这个方法。 ^_^
这句好像有问题吧,
一般返回应该是用getCursor方法的