Leela
Posts: 16
Nickname: leee
Registered: Sep, 2003
|
|
Re: how will i get total no of rows in the table..
|
Posted: Sep 19, 2003 1:54 AM
|
|
Actually what i meant was,
Statement stmt=conn.createStatement();//conn being the Connection Object ResultSet rs = stmt.executeQuery("select count(*)......");
int count=rs.getInt(1); // instead of getInt(0);
This is because if u have a query like,
Select name,age,sal from employee
then , name will be rs.getString(1); age=rs.getInt(2);
the indexing into the columns of the table starts from 1, and not 0.
|
|