pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedJdbcRowSet Problem
2+ messages / 1 participants
[nested] [flat]
* JdbcRowSet Problem
@ 2005-07-25 19:40 Dennis Gesker <dennis@gesker.com>
2005-07-25 21:18 ` Re: JdbcRowSet Problem Dennis Gesker <dennis@gesker.com>
0 siblings, 1 reply; 2+ messages in thread
From: Dennis Gesker @ 2005-07-25 19:40 UTC (permalink / raw)
To: 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);
}
}
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: JdbcRowSet Problem
2005-07-25 19:40 JdbcRowSet Problem Dennis Gesker <dennis@gesker.com>
@ 2005-07-25 21:18 ` Dennis Gesker <dennis@gesker.com>
0 siblings, 0 replies; 2+ messages in thread
From: Dennis Gesker @ 2005-07-25 21:18 UTC (permalink / raw)
To: Dennis Gesker <dennis@gesker.com>; +Cc: pgsql-jdbc
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);
> }
> }
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2005-07-25 21:18 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-07-25 19:40 JdbcRowSet Problem Dennis Gesker <dennis@gesker.com>
2005-07-25 21:18 ` Dennis Gesker <dennis@gesker.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox