× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Maybe I have a bad implementation theory, but whenever I have updateable
rows in my Java apps (strictly web UI's) I keep the cursors read only and
then just go through the changed screen fields and run update statements.

My approach may be a little inherent because I use Hibernate with connection
pooling.

Aaron Bartell

-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Titus Kruse
Sent: Tuesday, June 14, 2005 9:18 AM
To: java400-l@xxxxxxxxxxxx
Subject: Updatable ResultSet isn't updatable

Hi!

I want to update a row in an updatable resultset. But SQLException 510
(cursor for file write protected) has been thrown. Displaying the server job
shows, that the db-file was opened read only. Why that?

I'm using the IBM Java Toolbox JDBC 2.0 driver with DB/400 V5R2. Here is my
code:

    DriverManager.registerDriver(new
com.ibm.as400.access.AS400JDBCDriver());
    con = DriverManager.getConnection ("jdbc:as400://.../", "...", "...");
    con.setAutoCommit(false);
    stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);
    rs = stmt.executeQuery("SELECT * FROM AVEFM ORDER BY SRT");
    rs.absolute(row);
    /* Modify some columns */
    rs.updateRow();
    con.commit();

Thanks for any help,

Titus




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.