From dennis@gesker.com Mon Jul 25 19:41:18 2005 X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B4E7752B46 for ; Mon, 25 Jul 2005 16:41:18 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 73167-08 for ; Mon, 25 Jul 2005 19:41:08 +0000 (GMT) Received: from mail.alamon.com (s1-7-rb5.ka.centurytel.net [207.118.56.7]) by svr1.postgresql.org (Postfix) with ESMTP id A838452BFD for ; Mon, 25 Jul 2005 16:40:57 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alamon.com (Postfix) with ESMTP id 352A824C237 for ; Mon, 25 Jul 2005 13:40:38 -0600 (MDT) Received: from mail.alamon.com ([127.0.0.1]) by localhost (mail.alamon.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 08209-08 for ; Mon, 25 Jul 2005 13:40:22 -0600 (MDT) Received: from [10.0.9.223] (gesker.alamon.com [10.0.9.223]) by mail.alamon.com (Postfix) with ESMTP id 9DCA524C605 for ; Mon, 25 Jul 2005 13:40:22 -0600 (MDT) Message-ID: <42E54026.1020506@gesker.com> Date: Mon, 25 Jul 2005 13:40:22 -0600 From: Dennis Gesker Organization: Gesker.com User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: JdbcRowSet Problem Content-Type: multipart/alternative; boundary="------------020408030200070709090800" X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at alamon.com X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.149 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO, HTML_50_60, HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200507/297 X-Sequence-Number: 13445 This is a multi-part message in MIME format. --------------020408030200070709090800 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hello All: I seem to be having a strange problem with the JDBC driver. I'm writing a simple Swing application where a JTable is populated from data in a postgres database. I'm using a JdbcRowSet. The table populates just fine. However, I can't seem to update the information in the JTable. Below is the code added to the JTables tablemodel to update the data. No error is returned and it appears that all command in this function are called. Is anyone else having this kind of problem? Could some point me in the right direction? Thanks Dennis public void setValueAt(Object value, int rowIndex, int columnIndex){ try { rowSet.absolute(rowIndex + 1); rowSet.setObject(columnIndex + 1, value); rowSet.updateRow(); fireTableCellUpdated(rowIndex, columnIndex); JOptionPane.showMessageDialog(null, "Got here."); } catch (SQLException sqle) { do { System.err.println("Exception occourred\nMessage: " + sqle.getMessage()); System.err.println("SQL state: " + sqle.getSQLState()); System.err.println("Vendor code: " + sqle.getErrorCode()); System.err.println("---------------------------------"); } while ((sqle = sqle.getNextException()) != null); } } --------------020408030200070709090800 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello All:

I seem to be having a strange problem with the JDBC driver. I'm writing a simple Swing application where a JTable is populated from data in a postgres database. I'm using a JdbcRowSet. The table populates just fine.

However, I can't seem to update the information in the JTable. Below is the code added to the JTables tablemodel to update the data.

No error is returned and it appears that all command in this function are called.

Is anyone else having this kind of problem? Could some point me in the right direction?

Thanks
Dennis




    public void setValueAt(Object value, int rowIndex, int columnIndex){
  try {

            rowSet.absolute(rowIndex + 1);
            rowSet.setObject(columnIndex + 1, value);
            rowSet.updateRow();
            fireTableCellUpdated(rowIndex, columnIndex);
            JOptionPane.showMessageDialog(null, "Got here.");

        } catch (SQLException sqle) {
            do {
                System.err.println("Exception occourred\nMessage: "
                        + sqle.getMessage());
                System.err.println("SQL state: " + sqle.getSQLState());
                System.err.println("Vendor code: " + sqle.getErrorCode());
                System.err.println("---------------------------------");
            } while ((sqle = sqle.getNextException()) != null);
        }
    }
--------------020408030200070709090800-- From dennis@gesker.com Mon Jul 25 21:19:06 2005 X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 4864052EC2 for ; Mon, 25 Jul 2005 18:19:06 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 97592-08 for ; Mon, 25 Jul 2005 21:19:01 +0000 (GMT) Received: from mail.alamon.com (s1-7-rb5.ka.centurytel.net [207.118.56.7]) by svr1.postgresql.org (Postfix) with ESMTP id 98A4F52EEE for ; Mon, 25 Jul 2005 18:18:59 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alamon.com (Postfix) with ESMTP id 5619624C606 for ; Mon, 25 Jul 2005 15:19:02 -0600 (MDT) Received: from mail.alamon.com ([127.0.0.1]) by localhost (mail.alamon.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 11103-02 for ; Mon, 25 Jul 2005 15:18:55 -0600 (MDT) Received: from [10.0.9.223] (gesker.alamon.com [10.0.9.223]) by mail.alamon.com (Postfix) with ESMTP id 31FF524C2C1; Mon, 25 Jul 2005 15:18:55 -0600 (MDT) Message-ID: <42E5573F.3020405@gesker.com> Date: Mon, 25 Jul 2005 15:18:55 -0600 From: Dennis Gesker Organization: Gesker.com User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Dennis Gesker Cc: pgsql-jdbc@postgresql.org Subject: Re: JdbcRowSet Problem References: <42E54026.1020506@gesker.com> In-Reply-To: <42E54026.1020506@gesker.com> Content-Type: multipart/alternative; boundary="------------020704070705080607070704" X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at alamon.com X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.17 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO, HTML_50_60, HTML_MESSAGE, HTML_TITLE_EMPTY X-Spam-Level: X-Archive-Number: 200507/298 X-Sequence-Number: 13446 This is a multi-part message in MIME format. --------------020704070705080607070704 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Apparently I also needed a rowSet.updateObject statment. I'm working now. --drg Dennis Gesker wrote: > Hello All: > > I seem to be having a strange problem with the JDBC driver. I'm > writing a simple Swing application where a JTable is populated from > data in a postgres database. I'm using a JdbcRowSet. The table > populates just fine. > > However, I can't seem to update the information in the JTable. Below > is the code added to the JTables tablemodel to update the data. > > No error is returned and it appears that all command in this function > are called. > > Is anyone else having this kind of problem? Could some point me in the > right direction? > > Thanks > Dennis > > > > > public void setValueAt(Object value, int rowIndex, int columnIndex){ > try { > > rowSet.absolute(rowIndex + 1); > rowSet.setObject(columnIndex + 1, value); > rowSet.updateRow(); > fireTableCellUpdated(rowIndex, columnIndex); > JOptionPane.showMessageDialog(null, "Got here."); > > } catch (SQLException sqle) { > do { > System.err.println("Exception occourred\nMessage: " > + sqle.getMessage()); > System.err.println("SQL state: " + sqle.getSQLState()); > System.err.println("Vendor code: " + sqle.getErrorCode()); > System.err.println("---------------------------------"); > } while ((sqle = sqle.getNextException()) != null); > } > } --------------020704070705080607070704 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Apparently I also needed a rowSet.updateObject statment.  I'm working now.  --drg
Dennis Gesker wrote:
Hello All:

I seem to be having a strange problem with the JDBC driver. I'm writing a simple Swing application where a JTable is populated from data in a postgres database. I'm using a JdbcRowSet. The table populates just fine.

However, I can't seem to update the information in the JTable. Below is the code added to the JTables tablemodel to update the data.

No error is returned and it appears that all command in this function are called.

Is anyone else having this kind of problem? Could some point me in the right direction?

Thanks
Dennis




    public void setValueAt(Object value, int rowIndex, int columnIndex){
  try {

            rowSet.absolute(rowIndex + 1);
            rowSet.setObject(columnIndex + 1, value);
            rowSet.updateRow();
            fireTableCellUpdated(rowIndex, columnIndex);
            JOptionPane.showMessageDialog(null, "Got here.");

        } catch (SQLException sqle) {
            do {
                System.err.println("Exception occourred\nMessage: "
                        + sqle.getMessage());
                System.err.println("SQL state: " + sqle.getSQLState());
                System.err.println("Vendor code: " + sqle.getErrorCode());
                System.err.println("---------------------------------");
            } while ((sqle = sqle.getNextException()) != null);
        }
    }
--------------020704070705080607070704--