| Author |
Control the loop of resultset.next( );
|
Hewa Naimanage Sumedha Amalka
Greenhorn
Joined: Oct 31, 2006
Posts: 19
|
|
Hai, guys I am using the ODBC database (Excel Sheet) and i wanna get the records from it. My code is scucess but there is a problem in resultset.next() method. The thing is it retrieving all the data including the none data fields, so finally it became a never ending loop. pls help me to get the data rang's records Statement stmnt = connexl.createStatement(); String query = "SELECT * FROM [IJTS$]"; stmnt.execute(query); ResultSet rsxl = stmnt.getResultSet(); while(rsxl.next()) { String excelname = rsxl.getString(1); String excelcate = rsxl.getString(2); System.out.print(rsxl.getString(1)); System.out.println(" "+rsxl.getString(2)); } Thanks
|
SCJP 1.4 71%, SCWCD 1.5 84%, SCBCD 90%, SCMAD 98%
|
 |
Prabhu Venkatachalam
Ranch Hand
Joined: Nov 16, 2005
Posts: 502
|
|
Try this. It should work.
|
Prabhu Venkatachalam<br />SCJP 1.4,SCWCD 1.4<br />prabhu.venkatachalam@gmail.com
|
 |
 |
|
|
subject: Control the loop of resultset.next( );
|
|
|