Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

jdbc modifying/deletion of entire rows..

843854Oct 29 2001 — edited Oct 29 2001
Hi..

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());
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 26 2001
Added on Oct 29 2001
5 comments
87 views