JDBC problem with Postgres 7.0.3

From: Santosh Rau <srau(at)pumatech(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: JDBC problem with Postgres 7.0.3
Date: 2001-02-20 19:47:18
Message-ID: 3A92C9C6.F894CABD@pumatech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I am using the postgres driver for my Java code (JDK 1.2.2) which came
with the Postgres 7.0.3 tar file. I am trying get the name of a column
which is essentially the primary key in this table. Unfortunately, the
result set returned does not have any records(as shown below). This code

works fine on Oracle. I also tried jdbc7.0-1.2.jar but the same problem
occurs.

---- Code ----
public String getUniqueRowName() throws SQLException{
DatabaseMetaData dma = m_Connection.getMetaData();
ResultSet rs = dma.getIndexInfo("", "", "<table name>", true,
false);
if(rs == null){
return null;
}
rs.next(); ============================No records here
String sIndex = rs.getString("COLUMN_NAME");
return sIndex;
}

Any help is appreciated.

Thanks in advance for your time

Santosh Rau

Browse pgsql-general by date

  From Date Subject
Next Message Bill Barnes 2001-02-20 19:52:53 Re: Re: A How-To: PostgreSQL from Tcl via ODBC
Previous Message Adam Haberlach 2001-02-20 19:38:25 user meta (to the database, at least) information