Naseem : The code works fine when there is only one thread. So there is no problem in the SP.
This is the code which establishes the connection and uses the resultSet :
//Code starts
public class ITDDatabaseManager {
private static CallableStatement callable4 = null;
private static ResultSet resultSet = null;
private Connection conn = null;
public void doConnection() {
//this method establishes connection with the database
}
public int getDownloadData(
String filename, String arg0, int fileType) {
try{
//Check whether the DB connection
if (conn==null || conn.isClosed()){
doConnection();
}
//Prepare callable statement
callable4 = getCallableStmt(case1);
//register all the inputs and outputs
registerAllParams(case1);
//Execute the Sp
callable4.execute();
//get the outputs and check for errors
succInd = callable4.getInt(3);
retVal = callable4.getInt(4);
resultSet = callable4.getResultSet();
if (succInd == 0 && retVal == 0){
//There is no error
}
while(resultSet!=null && resultSet.next()){
//do the operation meant to be done
}
}catch(Exception e){
}
//Code ends
Regards