• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

My updatable result sets have suddenly become non-updatable

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear all -

The following code used to work and now it is not working. I'm on Windows 8.1 using netbeans. Don't know if it an MS file permission thing or what. It just stopped working and I haven't changed anything that I remember.

Thanks

private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {
try {
String uName = "guest";
String uPass = "guest";
String host = "jdbc:derby://localhost:1527/erTracker";
Connection erTrackerCon = DriverManager.getConnection( host,uName,uPass );

// erTrackerCon.setAutoCommit(true);
milestonesStmt = erTrackerCon.createStatement( ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
String SQL = "SELECT * FROM milestones order by milestoneID";
rsMilestones = milestonesStmt.executeQuery( SQL );
String a = "02";
String b = "M";
String c = "Move to prospect";
int concurrency = rsMilestones.getConcurrency();
System.out.println("the answer is " + concurrency); // the answer is 1007
rsMilestones.moveToInsertRow(); // this gives the following error: 'moveToInsertRow' not allowed because the ResultSet is not an updatable ResultSet.
rsMilestones.updateString("milestoneID", a);
rsMilestones.updateString("milestoneType",b);
rsMilestones.updateString("milestoneName", c);
rsMilestones.insertRow( );
//String SQL = "INSERT INTO milestones (milestoneid,milestonetype,milestongname) VALUES ('02','M','move to pursue')";
//rsMilestones = milestonesStmt.executeQuery( SQL );
}
catch ( SQLException err ) {
System.out.println( err.getMessage( ) );
}
}
 
reply
    Bookmark Topic Watch Topic
  • New Topic