Skip site navigation (1) Skip section navigation (2)

JdbcRowSet Problem

From: Dennis Gesker <dennis(at)gesker(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: JdbcRowSet Problem
Date: 2005-07-25 19:40:22
Message-ID: 42E54026.1020506@gesker.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
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);
        }
    }

Responses

pgsql-jdbc by date

Next:From: Dennis GeskerDate: 2005-07-25 21:18:55
Subject: Re: JdbcRowSet Problem
Previous:From: Dave CramerDate: 2005-07-25 18:58:09
Subject: Re: Timestamp Summary

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group