It's not a secret anymore!
The moose likes JDBC and Relational Databases and the fly likes Updateable ResultSet Help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Updateable ResultSet Help" Watch "Updateable ResultSet Help" New topic

Updateable ResultSet Help

Philip Hung

Joined: Dec 11, 2001
Posts: 10
Here is a code snippet of my problem, I basically traverse the whole ResultSet and check each value and replace them with a corrected value if I found any violating a fix set of rules, for simplicity sake in this example I test if the value is lowercase and change it to uppercase: (I'm using an Oracle 8i database)
Connection con = DriverManager.getConnection(url,
"myLogin", "myPassword");
Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
String schema = "Schema1";
ResultSet rs = stmt.executeQuery("Select alias.* from " + schema + ".mytable alias");
ResultSetMetaData rsMeta = rs.getMetaData();
int count = rsMeta.getColumnCount();
boolean change;
while ({
change = false;
for (int ctr = 1; ctr <= count; ++ ctr){
String temp = rs.getString(ctr);
if (!temp.equals(temp.toUpperCase())){
change = true;
if (change == true) {
rs.updateRow(); // Update changes
We have two table setup one for testing and one for development, configured as different schemas but with table structures created similarly. I use the above mentioned code on the development table and it works nicely. However, when I tested it against the testing table (by changing schema variable), the application seems to hang at the rs.updateRow() call. What are the possible explanation for this and how do I resolve this?
Please help. Thanks in advance.
I agree. Here's the link:
subject: Updateable ResultSet Help
It's not a secret anymore!