String stt = getJdbcTemplate().execute(
new ConnectionCallback() {
public Object doInConnection(Connection conn)
throws SQLException {
CallableStatement cstmt = conn.prepareCall("{call books_procedure()}");
ResultSet rst = cstmt.executeQuery();
String st = null;
while(rst.next()){
st = rst.getString(1);
System.out.println(st);
}
cstmt.close();
return st;
}
});
System.out.println(stt);
new ConnectionCallback() {
public Object doInConnection(Connection conn)
throws SQLException {
CallableStatement cstmt = conn.prepareCall("{call books_procedure()}");
ResultSet rst = cstmt.executeQuery();
String st = null;
while(rst.next()){
st = rst.getString(1);
System.out.println(st);
}
cstmt.close();
return st;
}
});
System.out.println(stt);