code optimization for large result sets

I have queries which take 30+ seconds to complete when called by the client. The queries return a large result set, number of rows. The queries actually only takes less than two seconds. It is populating the CORBA structs that is taking all the time. Any ideas on how to improve? An exampleis below. thanks.

Scott

PreparedStatement ps = con.prepareStatement(USER_READY_TASK_LIST_SEL);

ResultSet rs = ps.executeQuery();

String taskID ="";

String taskName="";

inttaskStatus=0;

String task_statusValue="";

String jobID ="";

String jobName ="";

int attribIntValue=0;

int recordCount=0;

while(rs.next())

{

taskID= rs.getString(1);

taskName = rs.getString(2);

taskStatus= rs.getInt(3);

task_statusValue = rs.getString(4);

jobID= rs.getString(5);

System.out.println(jobID.getBytes().length);

jobName = rs.getString(6);

attribIntValue= rs.getInt(7);

}

}

[1012 byte] By [scottb022563] at [2007-9-26 3:58:54]
# 1

It's a very commun problem, in fact.

Every time you ask the recordset to go further, I mean "next()", there's one network connection behind. So if you want to make your program run faster, just retrieve the whole data you want to analyse in a Vector or ... List() or what you want; and then use your Vector() class to handle the data. By this way, you'll waste less time in network connection...

Hope this will help

sylvain.barbot at 2007-6-29 12:52:19 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...