Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 60077 invoked from network); 26 Feb 2009 23:49:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Feb 2009 23:49:24 -0000 Received: (qmail 83162 invoked by uid 500); 26 Feb 2009 23:49:23 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 83132 invoked by uid 500); 26 Feb 2009 23:49:23 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 82984 invoked by uid 99); 26 Feb 2009 23:49:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Feb 2009 15:49:23 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Feb 2009 23:49:22 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 16551234C4A8 for ; Thu, 26 Feb 2009 15:49:02 -0800 (PST) Message-ID: <2051682170.1235692142090.JavaMail.jira@brutus> Date: Thu, 26 Feb 2009 15:49:02 -0800 (PST) From: "jaoued zahraoui (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-4076) rowset.insertRow() does not working In-Reply-To: <1144058631.1235692142029.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-4076?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:all-tabpanel ] jaoued zahraoui updated DERBY-4076: ----------------------------------- Description:=20 trying this code :=20 =09public static void main(String[] args) { =09=09CachedRowSetImpl res =3D null; =09=09try { =09=09=09res =3D new CachedRowSetImpl(); =09=09=09res.setCommand(RequestLoader.strGetListEntries); =09=09=09res.setTableName("ADDRESS"); =09=09=09res.setType(ResultSet.TYPE_FORWARD_ONLY); =09=09=09res.setConcurrency(ResultSet.CONCUR_UPDATABLE); =09=09=09Connection conn =3D Dbconnect.getInstance().getDbConnection(); =09=09=09res.execute(conn); =09=09=09 =09=09=09 =09=09=09// Check ResultSet's updatability =09=09=09if (res.getConcurrency() =3D=3D ResultSet.CONCUR_READ_ONLY) { =09=09=09=09System.out.println("ResultSet non-updatable."); =09=09=09} else { =09=09=09=09System.out.println("ResultSet updatable."); =09=09=09} =09=09=09// Move the cursor to the insert row =09=09=09res.moveToInsertRow(); =09=09=09// Set the new first name and last name =09=09=09// System.out.println("ID : " + rs.getInt("ID")); =09=09=09res.updateString("LASTNAME", "aaaaa"); =09=09=09res.updateString("FIRSTNAME", "aaaaa"); =09=09=09res.updateString("MIDDLENAME", "aaaaa"); =09=09=09res.updateString("PHONE", "aaaaa"); =09=09=09res.updateString("EMAIL", "aaaaa"); =09=09=09res.updateString("ADDRESS1", "aaaaa"); =09=09=09res.updateString("ADDRESS2", "aaaaa"); =09=09=09res.updateString("CITY", "aaaaa"); =09=09=09res.updateString("STATE", "aaaaa"); =09=09=09res.updateString("POSTALCODE", "aaaaa"); =09=09=09res.updateString("COUNTRY", "aaaaa"); =09=09=09// Store the insert into database =09=09=09res.insertRow(); =09=09=09// Move the curesor back to the current row =09=09=09res.moveToCurrentRow(); =09=09=09System.out.println("Row inserted ok."); =09=09=09// Close ResultSet and Statement =09=09=09res.close(); =09=09} catch (Exception e) { =09=09=09e.printStackTrace(); =09=09} =09} resuting in : ResultSet updatable. java.sql.SQLException: =C3=89chec de l'insertion de ligne =09at com.sun.rowset.CachedRowSetImpl.insertRow(Unknown Source) =09at fr.free.zahraoui.test.database.DerbyRowSetInsertRow.main(DerbyRowSetI= nsertRow.java:49) DerbyRowSetInsertRow.java:49 represent : res.insertRow(); was: trying this code :=20 =09public static void main(String[] args) { =09=09CachedRowSetImpl res =3D null; =09=09try { =09=09=09res =3D new CachedRowSetImpl(); =09=09=09res.setCommand(RequestLoader.strGetListEntries); =09=09=09res.setTableName("ADDRESS"); =09=09=09res.setType(ResultSet.TYPE_FORWARD_ONLY); =09=09=09res.setConcurrency(ResultSet.CONCUR_UPDATABLE); =09=09=09Connection conn =3D Dbconnect.getInstance().getDbConnection(); =09=09=09res.execute(conn); =09=09=09 =09=09=09 =09=09=09// Check ResultSet's updatability =09=09=09if (res.getConcurrency() =3D=3D ResultSet.CONCUR_READ_ONLY) { =09=09=09=09System.out.println("ResultSet non-updatable."); =09=09=09} else { =09=09=09=09System.out.println("ResultSet updatable."); =09=09=09} =09=09=09// Move the cursor to the insert row =09=09=09res.moveToInsertRow(); =09=09=09// Set the new first name and last name =09=09=09// System.out.println("ID : " + rs.getInt("ID")); =09=09=09res.updateString("LASTNAME", "aaaaa"); =09=09=09res.updateString("FIRSTNAME", "aaaaa"); =09=09=09res.updateString("MIDDLENAME", "aaaaa"); =09=09=09res.updateString("PHONE", "aaaaa"); =09=09=09res.updateString("EMAIL", "aaaaa"); =09=09=09res.updateString("ADDRESS1", "aaaaa"); =09=09=09res.updateString("ADDRESS2", "aaaaa"); =09=09=09res.updateString("CITY", "aaaaa"); =09=09=09res.updateString("STATE", "aaaaa"); =09=09=09res.updateString("POSTALCODE", "aaaaa"); =09=09=09res.updateString("COUNTRY", "aaaaa"); =09=09=09// Store the insert into database =09=09=09res.insertRow(); =09=09=09// Move the curesor back to the current row =09=09=09res.moveToCurrentRow(); =09=09=09System.out.println("Row inserted ok."); =09=09=09// Close ResultSet and Statement =09=09=09res.close(); =09=09} catch (Exception e) { =09=09=09e.printStackTrace(); =09=09} =09} resuting in : ResultSet updatable. java.sql.SQLException: =C3=89chec de l'insertion de ligne =09at com.sun.rowset.CachedRowSetImpl.insertRow(Unknown Source) =09at fr.free.zahraoui.test.database.DerbyRowSetInsertRow.main(DerbyRowSetI= nsertRow.java:49) Derby Categories: [Embedded/Client difference, High Value Fix] (was: [= High Value Fix, Embedded/Client difference]) > rowset.insertRow() does not working > ----------------------------------- > > Key: DERBY-4076 > URL: https://issues.apache.org/jira/browse/DERBY-4076 > Project: Derby > Issue Type: Bug > Components: JDBC > Affects Versions: 10.4.2.0 > Environment: windows 32b eclipse ganymede=20 > Reporter: jaoued zahraoui > Priority: Critical > Fix For: 10.4.2.1 > > > trying this code :=20 > =09public static void main(String[] args) { > =09=09CachedRowSetImpl res =3D null; > =09=09try { > =09=09=09res =3D new CachedRowSetImpl(); > =09=09=09res.setCommand(RequestLoader.strGetListEntries); > =09=09=09res.setTableName("ADDRESS"); > =09=09=09res.setType(ResultSet.TYPE_FORWARD_ONLY); > =09=09=09res.setConcurrency(ResultSet.CONCUR_UPDATABLE); > =09=09=09Connection conn =3D Dbconnect.getInstance().getDbConnection(); > =09=09=09res.execute(conn); > =09=09=09 > =09=09=09 > =09=09=09// Check ResultSet's updatability > =09=09=09if (res.getConcurrency() =3D=3D ResultSet.CONCUR_READ_ONLY) { > =09=09=09=09System.out.println("ResultSet non-updatable."); > =09=09=09} else { > =09=09=09=09System.out.println("ResultSet updatable."); > =09=09=09} > =09=09=09// Move the cursor to the insert row > =09=09=09res.moveToInsertRow(); > =09=09=09// Set the new first name and last name > =09=09=09// System.out.println("ID : " + rs.getInt("ID")); > =09=09=09res.updateString("LASTNAME", "aaaaa"); > =09=09=09res.updateString("FIRSTNAME", "aaaaa"); > =09=09=09res.updateString("MIDDLENAME", "aaaaa"); > =09=09=09res.updateString("PHONE", "aaaaa"); > =09=09=09res.updateString("EMAIL", "aaaaa"); > =09=09=09res.updateString("ADDRESS1", "aaaaa"); > =09=09=09res.updateString("ADDRESS2", "aaaaa"); > =09=09=09res.updateString("CITY", "aaaaa"); > =09=09=09res.updateString("STATE", "aaaaa"); > =09=09=09res.updateString("POSTALCODE", "aaaaa"); > =09=09=09res.updateString("COUNTRY", "aaaaa"); > =09=09=09// Store the insert into database > =09=09=09res.insertRow(); > =09=09=09// Move the curesor back to the current row > =09=09=09res.moveToCurrentRow(); > =09=09=09System.out.println("Row inserted ok."); > =09=09=09// Close ResultSet and Statement > =09=09=09res.close(); > =09=09} catch (Exception e) { > =09=09=09e.printStackTrace(); > =09=09} > =09} > resuting in : > ResultSet updatable. > java.sql.SQLException: =C3=89chec de l'insertion de ligne > =09at com.sun.rowset.CachedRowSetImpl.insertRow(Unknown Source) > =09at fr.free.zahraoui.test.database.DerbyRowSetInsertRow.main(DerbyRowSe= tInsertRow.java:49) > DerbyRowSetInsertRow.java:49 represent : res.insertRow(); --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.