|
I believe I found my answer in a message posted earlier on java400-L. ---------------------------------------------------------------------------- ---------------------- There is an example (and full javadoc) in the AS/400 Toolbox for Java Programmer's Guide (which is available for download from http://www.ibm.com/as400/toolbox). By default, ResultSets are read only - - as dictated by the JDBC specification. In order to make a ResultSet updatable, there are really 2 extra steps you have to take: 1. When you create the Statement, PreparedStatement, or CallableStatement, you have to specify a result set conncurency of CONCUR_UPDATABLE. This is business as usual for JDBC: Statement s = c.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); 2. When the AS/400 database opens a cursor (on behalf of a ResultSet), it does so as either read-only or updateable. When you execute your query, you have to tell it to open the cursor as updateable by using the FOR UPDATE clause: ResultSet rs = s.executeQuery ("SELECT NAME,ID FROM MYLIBRARY.MYTABLE FOR UPDATE"); The ResultSet will be updateable. Hope that helps, - Clif _______________________________________ Clifton M. Nock (cnock@us.ibm.com) AS/400 Toolbox for Java +--- | This is the JAVA/400 Mailing List! | To submit a new message, send your mail to JAVA400-L@midrange.com. | To subscribe to this list send email to JAVA400-L-SUB@midrange.com. | To unsubscribe from this list send email to JAVA400-L-UNSUB@midrange.com. | Questions should be directed to the list owner: joe@zappie.net +---
As an Amazon Associate we earn from qualifying purchases.
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.