db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob M <rgmatth...@orcon.net.nz>
Subject Help with code please
Date Wed, 23 Oct 2013 16:03:40 GMT

With the following code........I have a problem when trying to delete the
'oldest' record

The SELECT query retrieves the correct record as shown by the output but I
can not
delete this record without a "FOR UPDATE" at the end of the SELECT query and
my current SELECT query type CAN NOT have the "FOR UPDATE" added ????
so what code modifications do I need to do ?

The sql error I am getting is...................
'deleteRow' not allowed because the ResultSet is not an updatable ResultSet

// retrieve and output date and time of oldest record from the table 
rs = s.executeQuery("SELECT * FROM tablename ORDER BY Date ASC, Time ASC
String Date2 = rs.getString("Date"); 
String Time2 = rs.getString("Time"); 

myConsole.getOut().println("Date/Time: " + Date2 + ", " + Time2); 

// and now delete this record............. 
rs = deleteRow(); 

myConsole.getOut().println("Deleted oldest record");

View this message in context: http://apache-database.10148.n7.nabble.com/Help-with-code-please-tp134994.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.

View raw message