jdbc modifying/deletion of entire rows..
843854Oct 29 2001 — edited Oct 29 2001Hi..
I have a database...
at a given particular row I need to modify ALL columns in that row to something such as:('a','b','c','d','e','f','g')
Is there anyway to iterate through the rows until you get to the row you want? Like with this resultSet?
int row=z[z_index].getRow();
ROWNUM=row;
try
{
String query = "SELECT ID, D, BREED, SEX, SIZE, COLOR, HAIR FROM dogsDB";
con = DriverManager.getConnection(url);
stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(query);
int rowCount=0;
while (rs.next())
{
++rowCount;
if(row==rowCount)
{
//
//INSERT CODE TO MAKE IT INSERT INTO VAR ROW[ROWNUM]
//
}
}
stmt.close();
con.close();
}
catch(SQLException ex)
{
System.err.println("SQLException: " + ex.getMessage());
}