Re: Newbie question - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: Newbie question
Date
Msg-id Pine.BSO.4.56.0409241737040.27314@leary.csoft.net
Whole thread Raw
In response to Newbie question  (Anton Nikiforov <anton@nikiforov.ru>)
List pgsql-jdbc

On Sat, 25 Sep 2004, Anton Nikiforov wrote:

> Getting started with the JDBC programming i have some troubles:
> 1. Is there a kinda of solution to operate CIDR and other pgsql-specific
> value types with PGSQL+Java (i know, that i can use ::text to get and
> ::cidr to set, but maybe there are some classes that extend Type class
> that i did not find in the documentation)?

There are some java types that match postgresql specific types, but these
are mainly for geometric data types.  For now you need to just use get and
setString for these types.  Useful implementations for these types would
be accepted.

> 2. I found almost everything what i can get from Result/Database
> metadata, but found no way to know the table name that that was
> indicated in sql statemen during getting data.

Currently undocumented and only in the development version of the driver
there are methods PGResultSetMetaData.getBaseXXXName where XXX can be
Column, Table, or Schema.  This retieves the underlying table information
from a query result.

> 3. Is there any way to know that data in the database was changed
> (three-level application could do the trick, but i'm asking about simple
> way - JTable->JSorter->JModel->postgresql without using RMI or whatever)

You could use LISTEN/NOTIFY to create a solution to this, but there's no
standard or automatic way to make this happen.  Things like
ResultSet.rowUpdated() are not implemented.

Kris Jurka

pgsql-jdbc by date:

Previous
From: Anton Nikiforov
Date:
Subject: Newbie question
Next
From: Simon Moses
Date:
Subject: Arrays Question? -Simon Moses