Posted By:
Anonymous
Posted On:
Thursday, October 31, 2002 02:07 AM
Hi, I have been using JWSDP which internally using Tomcat Server. I am using a recursive method to populate the data from database into JavaObject.after some point of time data is not loading,I am not sure whether the problem is due to connection in connection pooling. After 6 levels deeper the problem is Coming,Here Below i am attaching the code snippet public Container getSubContainerList(String strcontainerID,Container cont){ String sql =""; ResultSet rs=null; ResultSet rs1=null; Container[] strcont = {}; Content[] strcontent={}; Statement stmt = null; Statement stmt1 = null;
More>>
Hi,
I have been using JWSDP which internally using Tomcat Server.
I am using a recursive method to populate the data from database into JavaObject.after some point of time data is not loading,I am not sure whether the problem is due to connection in connection pooling.
After 6 levels deeper the problem is Coming,Here Below i am attaching the code snippet
public Container getSubContainerList(String strcontainerID,Container cont){
String sql ="";
ResultSet rs=null;
ResultSet rs1=null;
Container[] strcont = {};
Content[] strcontent={};
Statement stmt = null;
Statement stmt1 = null;
int count = 0;
int containercount =0;
int contentcount =0;
try{
con = dBean.getConnection();
stmt = con.createStatement();
stmt1 = con.createStatement();
// cont = getContentList
(strcontainerID,cont);// to here
sql = "select count(*) as
container_count from DCAM_Container where ParentContainer_ID ='"+strcontainerID+"'";
//rs1 = getResultset(sql);
rs1 = stmt.executeQuery(sql);
while(rs1.next()){
containercount = rs1.getInt("container_count");
}
if(containercount > 0){
strcont = new Container[containercount];
}
else{
return cont;
}
// Changed from Here
sql = "select Container_ID,Container_Name from DCAM_Container where ParentContainer_ID ='"+strcontainerID+"'";
//rs = getResultset(sql);
rs = stmt1.executeQuery(sql);
while(rs.next()){
Container cont1 = new Container();
String strcontainerID1 = rs.getString("Container_ID");
String strcontainerName = rs.getString("Container_Name");
cont1.setContainerID(strcontainerID1);
cont1.setContainerName(strcontainerName);
LogWriter.errorLog("The sub Container Name is:"+strcontainerName);
cont1 = getSubContainerList(strcontainerID1,cont1);
strcont[count] = cont1;
count++;
}
cont.setContainer(strcont);
}catch(Exception ex){
LogWriter.errorLog("The error in getSubContainerList list..");
ex.printStackTrace();
}finally{
try{
if(con != null)
con.close();
if(stmt != null)
stmt.close();
if(stmt1 != null)
stmt1.close();
if(rs != null)
rs.close();
}catch(Exception ex){}
}
return cont;
}
Thanks in advance
Kishore
<<Less