Hi all
What am I doing wrong in the code below? The 2nd while(rs.next()) loop isn't
entered at all, and I definitely have 1 row returned. Any help much appreciated,
thanks :)
Ciao
Zak
int i = 0;
while (rs.next()) {
i++;
}
rs.first();
returnData = new Object[i][numCols];
System.out.println(i+" number rows returned");
for (i=1; i <= numCols ; i++) {
colTypeName[i-1]=rsmd.getColumnTypeName(i);
colType[i-1]=rsmd.getColumnType(i);
colName[i-1]=rsmd.getColumnName(i);
System.out.println(i + ": " + colName[i-1]);
}
int j=0;
rs.first();
System.out.println("Here...");
while(rs.next()) {
for (i=1; i <= numCols ; i++) {
// colName[i]=rsmd.getColumnName(i);
//colType[i]=rsmd.getColumnType(colName[i]);
System.out.println(i+": "+colName[i-1].toString());
returnData[j][i-1]=rs.getString(colName[i-1].toString());
System.out.println("***"+returnData[j][i-1]);
}
j++;
}
System.out.println("here now...");
rs.close();
--
--
========================================================================
http://www.carfolio.com/ Searchable database of 10 000+ car specs
Auctioning motoring-related items at eBay? http://www.carfolio.com/ebay/
========================================================================