Foreign Keys and getImportedKeys(..)

Поиск
Список
Период
Сортировка
От Ashvin Lad
Тема Foreign Keys and getImportedKeys(..)
Дата
Msg-id 3C598D08.7020608@doc.ic.ac.uk
обсуждение исходный текст
Ответы Re: Foreign Keys and getImportedKeys(..)
Список pgsql-jdbc
  Hi All,

After getting a metadata object from a PostgreSQL connection, I can use
the getPrimaryKeys() method
to display a table's primary keys but I can't use the getImportedKeys()
method to get its foreign keys. Can anyone help?

This works:

    ResultSet pksRS = dbmd.getPrimaryKeys(null, null, tableName);
    while(pksRS.next())
    {
        ... pksRS.getString("COLUMN_NAME");
    }

But this does not:

    ResultSet fksRS = dbmd.getImportedKeys(null, null, tableName);
    while(fksRS.next())
    {
        ... fksRS.getString("FKCOLUMN_NAME");
    }

I get a NullPointerException because fksRS is null, but I don't know why.
This is not the case when I use MS SQL Server...it does work.
Is this because the JDBC driver provided with PostgreSQL doesn't support
this function?

Thanks,

Ash.


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Barry Lind
Дата:
Сообщение: Re: getConnection() method of PreparedStatement
Следующее
От: "Dave Cramer"
Дата:
Сообщение: Re: Foreign Keys and getImportedKeys(..)