Please Help me with Result set

Hi,

Please help me with this. Thanks in advance

If I want to pass each instance from a java class (below) from ResultSet to another Object2 (calling as Object2 obj2 = new Object2(instance), from the resultset ), how can I pass them one by one (I can't use list and passing the whole list to the new Object because it will be too much infor for RAM to handle at the same time)

StringBuffer sql =new StringBuffer();

try{

SQL tmasql =new SQL();

Connection conn = tmasql.getConnection();

sql.append("SELECT a.agent_id, ......");

sql.append("FROM job ");

.......

PreparedStatement st = conn.prepareStatement(sql.toString());

ResultSet rs = st.executeQuery();

Object obj =null;

while (rs.next()){

obj =new Object();

obj.setAgentID(rs.getInt(1));

......

obj..setLast(rs.getString(31));

}

st.close();

rs.close();

tmasql.close();

}

[1329 byte] By [katieqa] at [2007-11-26 19:22:30]
# 1
It worked. Thanks!
katieqa at 2007-7-9 21:43:08 > top of Java-index,Java Essentials,New To Java...