This discussion is archived
1 Reply Latest reply: Aug 21, 2012 4:03 AM by gimbal2 RSS

Calling the proc and run the tempoaray table data is blank..

891682 Newbie
Currently Being Moderated
Hi,
Through java code,I did call the proc and after that run the temporary table But no Records is coming but when i did run the proc in Oracle and run the Query then Result is coming .
So Plz help me why record is not coming though java code..Here I am sending the code below..

package client;

import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;

import java.util.List;

public class LimitStatusRep {

public static void main(String[] args) {

DbConnection conn =new DbConnection();

Connection con = conn.getCon();
StringBuffer query = new StringBuffer("begin dbpkg_rpt_processing.XBDBP_GEN_LIMIT_STATUS_REP(?,?,?,?); end;");
CallableStatement cbstmt;
// code copy
try {
cbstmt = con.prepareCall(query.toString());
cbstmt.setString("P_LIMIT_ID", null);
cbstmt.setString("P_TYP", "FOLIO");
cbstmt.setString("P_VALUE", "AMFOLIO");
cbstmt.setDate("P_DATE ", null);
cbstmt.executeUpdate();
Statement stmt;
String q="select * from r_limit_status where rownum<5";//r_limit_status

stmt=con.createStatement();
ResultSet rs=stmt.executeQuery(q);
System.out.println("rs--------");
while(rs.next()) {
System.out.println("22222222");
System.out.println("actual val "+rs.getString(1));
}
System.out.println("3333333");

} catch (SQLException e) {
e.printStackTrace();
}

}
}

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points