From: Þórhallur Hálfdánarson <tolli@margmidlun.is>
To: 'Peter Mount' <petermount@it.maidstone.gov.uk>
Cc: 'pgsql-interfaces@postgresql.org' <pgsql-interfaces@postgresql.org>
Subject: RE: ResultSetMetaData problems (getColumnType() and -TypeName)
Date: Wed, 19 Jul 2000 14:04:32 -0000
Message-ID: <B0D96BEDD558D411ACB200105AD7EAE90A8809@GEMINI> (raw)
Me stupid. :-)
There were no rows returned. I didn't even think about that, I took it for
granted that this would be possible.
Is there any change that this will not be needed in future releases ?
Regards,
Tolli
> -----Original Message-----
> From: Peter Mount [mailto:petermount@it.maidstone.gov.uk]
> Sent: 19. júlí 2000 06:36
> To: 'Þórhallur Hálfdánarson'; 'pgsql-interfaces@postgresql.org'
> Subject: RE: [INTERFACES] ResultSetMetaData problems (getColumnType()
> and -TypeName)
>
>
> Can you run this with debugging enabled on the connection please?
>
> ie: After connecting issue the line:
> DriverManager.setLogStream(System.err);
>
> Ignore the compiler warning.
>
> The problem you have is that Field issues a small query to fetch the
> Column's name from pg_type and this query is failing. The
> output of the log
> may help see why this query is failing.
>
> Thanks, Peter
> --
> Peter Mount
> Enterprise Support
> Maidstone Borough Council
> Any views stated are my own, and not those of Maidstone
> Borough Council
> -----Original Message-----
> From: Þórhallur Hálfdánarson [mailto:tolli@margmidlun.is]
> Sent: Tuesday, July 18, 2000 5:21 PM
> To: 'pgsql-interfaces@postgresql.org'
> Subject: [INTERFACES] ResultSetMetaData problems (getColumnType() and
> -TypeName)
>
>
> Hi
> I've seen some postings on this subject since ages ago. The
> code and the
> output pretty much says what there has to be said (there was
> as example
> similar to this code somewhere). Sorry for the Icelandic, though. :-)
> <code>
> int iFjoldi = rsmd.getColumnCount();
> System.out.println("Fjöldi dálka í töflunni sjálfri: "+ iFjoldi);
> for (int i=1; i <= iFjoldi; i++)
> {
> System.out.println("Dálkur "+ i);
> try
> {
> rsmd = rs.getMetaData();
> System.out.println("Dálkur "+ i +": "+
> rsmd.getColumnType(i));
> System.out.println("Dálkur "+ i +": "+
> rsmd.getColumnTypeName(i));
> System.out.println("Ég er gimp");
> }
> catch (SQLException e)
> {
> System.out.println("Fönky SQL Exception: "+
> e.toString());
> }
> catch (Exception e)
> {
> System.out.println("Fönky Exception: "+
> e.toString());
> e.printStackTrace();
> }
> }
> </code>
> <output>
> Fjöldi dálka í töflunni sjálfri: 4
> Dálkur 1
> Fönky Exception: java.lang.NullPointerException:
> java.lang.NullPointerException:
> at org.postgresql.Connection.ExecSQL(Connection.java:312)
> at org.postgresql.Field.getSQLType(Field.java:79)
> at
> org.postgresql.jdbc2.ResultSetMetaData.getColumnType(ResultSet
> MetaData.java:
> 363)
> at
> com.margmidlun.LIN.Upplysingakerfi.Importer.go(Importer.java:132)
>
> at Gagnagaur.main(Gagnagaur.java:13)
> Dálkur 2
> Fönky Exception: java.lang.NullPointerException:
> java.lang.NullPointerException:
> at org.postgresql.Connection.ExecSQL(Connection.java:312)
> at org.postgresql.Field.getSQLType(Field.java:79)
> at
> org.postgresql.jdbc2.ResultSetMetaData.getColumnType(ResultSet
> MetaData.java:
> 363)
> at
> com.margmidlun.LIN.Upplysingakerfi.Importer.go(Importer.java:132)
>
> at Gagnagaur.main(Gagnagaur.java:13)
> Dálkur 3
> Fönky Exception: java.lang.NullPointerException:
> java.lang.NullPointerException:
> at org.postgresql.Connection.ExecSQL(Connection.java:312)
> at org.postgresql.Field.getSQLType(Field.java:79)
> at
> org.postgresql.jdbc2.ResultSetMetaData.getColumnType(ResultSet
> MetaData.java:
> 363)
> at
> com.margmidlun.LIN.Upplysingakerfi.Importer.go(Importer.java:132)
>
> at Gagnagaur.main(Gagnagaur.java:13)
> Dálkur 4
> Fönky Exception: java.lang.NullPointerException:
> java.lang.NullPointerException:
> at org.postgresql.Connection.ExecSQL(Connection.java:312)
> at org.postgresql.Field.getSQLType(Field.java:79)
> at
> org.postgresql.jdbc2.ResultSetMetaData.getColumnType(ResultSet
> MetaData.java:
> 363)
> at
> com.margmidlun.LIN.Upplysingakerfi.Importer.go(Importer.java:132)
>
> at Gagnagaur.main(Gagnagaur.java:13)
> </output>
>
>
> The same has shown up on setups:
> Setup A)
> Machine S)
> RedHat Linux 6.0
> PostgreSQL 6.5.1 (with JDBC, other stuff working fine)
> Machine J)
> RedHat Linux 6.1
> Sun JDK:
> java version "1.2.2"
> Classic VM (build 1.2.2-L, green threads, nojit)
> jdbc6.5-1.2.jar
> Setup B)
> Machine T)
> RedHat Linux 6.2
> PostgreSQL 7.0.2
> $ rpm -qa |grep postgres
> postgresql-jdbc-7.0.2-2
> postgresql-odbc-7.0.2-2
> postgresql-7.0.2-2
> postgresql-server-7.0.2-2
> postgresql-devel-7.0.2-2
> Sun JDK
>
>
>
> Now.... do you have any tips ?
>
>
> Regards,
> Tolli
> tolli@margmidlun.is
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-interfaces@postgresql.org
Cc: tolli@margmidlun.is, petermount@it.maidstone.gov.uk
Subject: Re: ResultSetMetaData problems (getColumnType() and -TypeName)
In-Reply-To: <B0D96BEDD558D411ACB200105AD7EAE90A8809@GEMINI>
References: <B0D96BEDD558D411ACB200105AD7EAE90A8809@GEMINI>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox