Newbie question

Поиск
Список
Период
Сортировка
Искать

Newbie question

От:
Anton Nikiforov <anton@nikiforov.ru>
Дата:
Вложения:
Dear All!

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)?
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.
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)

I'm kindly asking to give just an URL where i can find this type of 
information?

Best regards,
Anton Nikiforov

Re: Newbie question

От:
Kris Jurka <books@ejurka.com>
Дата:


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
FAQ