|
楼主 |
发表于 2014-2-25 14:05:45
|
显示全部楼层
java端action代码如下 :你说让我参照的代码要加到哪里呢??我试了试,没有东西输出,
public static void returntable(String v1,Table t1){
java.sql.Connection conn;
try{
conn = com.justep.model.ModelUtils.getConnection("/report/reptest/data");
java.sql.CallableStatement proc = conn.prepareCall("{call test2 (?,?)}");
proc.setString(1, v1);
proc.registerOutParameter(2, oracle.jdbc.OracleTypes.CURSOR);
proc.execute();
ResultSet rs = (ResultSet)proc.getObject(2);
while(rs.next())
{
System.out.println("<tr><td>" + rs.getString(1) + "</td><td>"+rs.getString(2)+"</td></tr>");
}
}
catch (NamingException e) {
e.printStackTrace();
return;
} catch (SQLException e) {
e.printStackTrace();
return;}
}
}
|
|