Re: getTables not returning 10 columns etc

From: the6campbells <the6campbells(at)gmail(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: getTables not returning 10 columns etc
Date: 2011-12-09 03:22:01
Message-ID: 0899e710-4c63-4f38-9c4e-a7540ed0c27e@a31g2000pre.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Dec 8, 9:47 pm, p(dot)(dot)(dot)(at)fastcrypt(dot)com (Dave Cramer) wrote:
> On Thu, Dec 8, 2011 at 8:10 PM, the6campbells <the6campbe(dot)(dot)(dot)(at)gmail(dot)com> wrote:
> > Is there any documentation that list for the all get* methods etc
> > where it is by design intent that the PG JDBC driver may not have a
> > result set with all the columns as documented in the JDBC docs?
>
> > For example getTables has 10 columns and the PG driver returns 5 or
> > the documentation uses upper case names such as TABLE_CAT but PG
> > driver returns lower case names etc.
>
> Which documentation ? By default postgres uses lower case names.
>
> You would have to provide a test case for use to diagnose this further.
>
>
>
> > --
> > Sent via pgsql-jdbc mailing list (pgsql-j(dot)(dot)(dot)(at)postgresql(dot)org)
> > To make changes to your subscription:
> >http://www.postgresql.org/mailpref/pgsql-jdbc
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-j(dot)(dot)(dot)(at)postgresql(dot)org)
> To make changes to your subscription:http://www.postgresql.org/mailpref/pgsql-jdbc

not sure my reply was sent previously so will try again

ResultSet rs = meta.getTables(null, null, null, null);
ResultSetMetaData rsmd = rs.getMetaData();

for (int i = 1; i <= rsmd.getColumnCount(); i++) {
System.out.println(rsmd.getColumnName(i));
}

http://docs.oracle.com/javase/6/docs/api/java/sql/DatabaseMetaData.html#getTables(java.lang.String,
java.lang.String, java.lang.String, java.lang.String[])

was expecting 10 not 5 columns and the names of the result columns for
the metadata methods to be independent in terms of how RDBMS vendors
may hold their system catalog.
assuming JDBC result column names are as per the docs UPPER CASE.

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Samuel Gendler 2011-12-09 06:50:56 Re: getTables not returning 10 columns etc
Previous Message the6campbells 2011-12-09 03:17:26 Re: getTables not returning 10 columns etc