Java Reference
In-Depth Information
in the result set
crs.beforeFirst();
// traverse result set
while (crs.next()) {
// If the recipe_num equals 11-2 then
update
if
(crs.getString("RECIPE_NUMBER").equals("13-2")) {
System.out.println("updating recipe
13-2");
crs.updateString("description",
"Subject to change");
crs.updateRow();
}
}
returnValue = true;
// Move to the position before the first row in
the result set
crs.beforeFirst();
// traverse result set to see changes
while (crs.next()) {
System.out.println(crs.getString(2)
+ ": " + crs.getString(3)
+ " - " + crs.getString(4));
}
} catch (SQLException ex) {
returnValue = false;
ex.printStackTrace();
}
return returnValue;
Search WWH ::




Custom Search