Received: from mars.mmedia.is (root@mars.mmedia.is [193.4.192.20]) by hub.org (8.10.1/8.10.1) with ESMTP id e6JE76h65596 for ; Wed, 19 Jul 2000 10:07:06 -0400 (EDT) Received: from gemini.mmedia.is ([10.35.36.3]) by mars.mmedia.is (8.9.3/8.9.3) with ESMTP id OAA24446; Wed, 19 Jul 2000 14:09:26 GMT Received: by GEMINI with Internet Mail Service (5.5.2448.0) id ; Wed, 19 Jul 2000 14:04:36 -0000 Message-ID: From: =?ISO-8859-1?Q?=DE=F3rhallur_H=E1lfd=E1narson?= To: "'Peter Mount'" Cc: "'pgsql-interfaces@postgresql.org'" Subject: RE: ResultSetMetaData problems (getColumnType() and -TypeName) Date: Wed, 19 Jul 2000 14:04:32 -0000 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2448.0) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01BFF18A.44A1B510" X-Archive-Number: 200007/144 This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01BFF18A.44A1B510 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable 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=FAl=ED 2000 06:36 > To: '=DE=F3rhallur H=E1lfd=E1narson'; 'pgsql-interfaces@postgresql.org' > Subject: RE: [INTERFACES] ResultSetMetaData problems (getColumnType() > and -TypeName) >=20 >=20 > Can you run this with debugging enabled on the connection please? >=20 > ie: After connecting issue the line: > DriverManager.setLogStream(System.err); >=20 > Ignore the compiler warning. >=20 > 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=20 > output of the log > may help see why this query is failing. >=20 > Thanks, Peter > --=20 > Peter Mount=20 > Enterprise Support=20 > Maidstone Borough Council=20 > Any views stated are my own, and not those of Maidstone=20 > Borough Council=20 > -----Original Message----- > From: =DE=F3rhallur H=E1lfd=E1narson [mailto:tolli@margmidlun.is] > Sent: Tuesday, July 18, 2000 5:21 PM > To: 'pgsql-interfaces@postgresql.org' > Subject: [INTERFACES] ResultSetMetaData problems (getColumnType() and > -TypeName) >=20 >=20 > Hi=20 > I've seen some postings on this subject since ages ago. The=20 > code and the > output pretty much says what there has to be said (there was=20 > as example > similar to this code somewhere). Sorry for the Icelandic, though. :-) > =20 > int iFjoldi =3D rsmd.getColumnCount();=20 > System.out.println("Fj=F6ldi d=E1lka =ED t=F6flunni sj=E1lfri: "+ iFjoldi= );=20 > for (int i=3D1; i <=3D iFjoldi; i++)=20 > {=20 > System.out.println("D=E1lkur "+ i);=20 > try=20 > {=20 > rsmd =3D rs.getMetaData();=20 > System.out.println("D=E1lkur "+ i +": "+ > rsmd.getColumnType(i));=20 > System.out.println("D=E1lkur "+ i +": "+ > rsmd.getColumnTypeName(i));=20 > System.out.println("=C9g er gimp");=20 > }=20 > catch (SQLException e)=20 > {=20 > System.out.println("F=F6nky SQL Exception: "+=20 > e.toString());=20 > }=20 > catch (Exception e)=20 > {=20 > System.out.println("F=F6nky Exception: "+=20 > e.toString());=20 > e.printStackTrace();=20 > }=20 > }=20 > =20 > =20 > Fj=F6ldi d=E1lka =ED t=F6flunni sj=E1lfri: 4=20 > D=E1lkur 1=20 > F=F6nky Exception: java.lang.NullPointerException:=20 > java.lang.NullPointerException:=20 > at org.postgresql.Connection.ExecSQL(Connection.java:312)=20 > at org.postgresql.Field.getSQLType(Field.java:79)=20 > at > org.postgresql.jdbc2.ResultSetMetaData.getColumnType(ResultSet > MetaData.java: > 363)=20 > at=20 > com.margmidlun.LIN.Upplysingakerfi.Importer.go(Importer.java:132) >=20 > at Gagnagaur.main(Gagnagaur.java:13)=20 > D=E1lkur 2=20 > F=F6nky Exception: java.lang.NullPointerException:=20 > java.lang.NullPointerException:=20 > at org.postgresql.Connection.ExecSQL(Connection.java:312)=20 > at org.postgresql.Field.getSQLType(Field.java:79)=20 > at > org.postgresql.jdbc2.ResultSetMetaData.getColumnType(ResultSet > MetaData.java: > 363)=20 > at=20 > com.margmidlun.LIN.Upplysingakerfi.Importer.go(Importer.java:132) >=20 > at Gagnagaur.main(Gagnagaur.java:13)=20 > D=E1lkur 3=20 > F=F6nky Exception: java.lang.NullPointerException:=20 > java.lang.NullPointerException:=20 > at org.postgresql.Connection.ExecSQL(Connection.java:312)=20 > at org.postgresql.Field.getSQLType(Field.java:79)=20 > at > org.postgresql.jdbc2.ResultSetMetaData.getColumnType(ResultSet > MetaData.java: > 363)=20 > at=20 > com.margmidlun.LIN.Upplysingakerfi.Importer.go(Importer.java:132) >=20 > at Gagnagaur.main(Gagnagaur.java:13)=20 > D=E1lkur 4=20 > F=F6nky Exception: java.lang.NullPointerException:=20 > java.lang.NullPointerException:=20 > at org.postgresql.Connection.ExecSQL(Connection.java:312)=20 > at org.postgresql.Field.getSQLType(Field.java:79)=20 > at > org.postgresql.jdbc2.ResultSetMetaData.getColumnType(ResultSet > MetaData.java: > 363)=20 > at=20 > com.margmidlun.LIN.Upplysingakerfi.Importer.go(Importer.java:132) >=20 > at Gagnagaur.main(Gagnagaur.java:13)=20 > =20 >=20 >=20 > The same has shown up on setups:=20 > Setup A)=20 > Machine S)=20 > RedHat Linux 6.0=20 > PostgreSQL 6.5.1 (with JDBC, other stuff working fine)=20 > Machine J)=20 > RedHat Linux 6.1=20 > Sun JDK:=20 > java version "1.2.2"=20 > Classic VM (build 1.2.2-L, green threads, nojit)=20 > jdbc6.5-1.2.jar=20 > Setup B)=20 > Machine T)=20 > RedHat Linux 6.2=20 > PostgreSQL 7.0.2=20 > $ rpm -qa |grep postgres=20 > postgresql-jdbc-7.0.2-2=20 > postgresql-odbc-7.0.2-2=20 > postgresql-7.0.2-2=20 > postgresql-server-7.0.2-2=20 > postgresql-devel-7.0.2-2=20 > Sun JDK=20 >=20 >=20 >=20 > Now.... do you have any tips ?=20 >=20 >=20 > Regards,=20 > Tolli=20 > tolli@margmidlun.is=20 >=20 ------_=_NextPart_001_01BFF18A.44A1B510 Content-Type: text/html; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable RE: [INTERFACES] ResultSetMetaData problems (getColumnType() and -T= ypeName)

Me stupid. :-)

There were no rows returned. I didn't even think about th= at, I took it for granted that this would be possible.

Is there any change that this will not be needed in futur= e releases ?


Regards,
Tolli


> -----Original Message-----
> From: Peter Mount [mailto:petermount@it.maidstone.gov.uk]
> Sent: 19. j=FAl=ED 2000 06:36
> To: '=DE=F3rhallur H=E1lfd=E1narson'; 'pgsql-interf= aces@postgresql.org'
> Subject: RE: [INTERFACES] ResultSetMetaData problem= s (getColumnType()
> and -TypeName)
>
>
> Can you run this with debugging enabled on the conn= ection please?
>
> ie: After connecting issue the line:
>         Dri= verManager.setLogStream(System.err);
>
> Ignore the compiler warning.
>
> The problem you have is that Field issues a small q= uery to fetch the
> Column's name from pg_type and this query is failin= g. 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 Maids= tone
> Borough Council
> -----Original Message-----
> From: =DE=F3rhallur H=E1lfd=E1narson [mailto:tolli@margmidlun.is]
> Sent: Tuesday, July 18, 2000 5:21 PM
> To: 'pgsql-interfaces@postgresql.org'
> Subject: [INTERFACES] ResultSetMetaData problems (g= etColumnType() 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 Icel= andic, though. :-)
> <code>
> int iFjoldi =3D rsmd.getColumnCount();
> System.out.println("Fj=F6ldi d=E1lka =ED t=F6f= lunni sj=E1lfri: "+ iFjoldi);
> for (int i=3D1; i <=3D iFjoldi; i++)
> {
>         Sys= tem.out.println("D=E1lkur "+ i);
>         try=
>         { <= /FONT>
>        &nbs= p;        rsmd =3D rs.getMetaData();
>        &nbs= p;        System.out.println("D=E1l= kur "+ i +": "+
> rsmd.getColumnType(i));
>        &nbs= p;        System.out.println("D=E1l= kur "+ i +": "+
> rsmd.getColumnTypeName(i));
>        &nbs= p;        System.out.println("=C9g = er gimp");
>         } <= /FONT>
>         cat= ch (SQLException e)
>         { <= /FONT>
>        &nbs= p;        System.out.println("F=F6n= ky SQL Exception: "+
> e.toString());
>         } <= /FONT>
>         cat= ch (Exception e)
>         { <= /FONT>
>        &nbs= p;        System.out.println("F=F6n= ky Exception: "+
> e.toString());
>        &nbs= p;        e.printStackTrace();
>         } <= /FONT>
> }
> </code>
> <output>
> Fj=F6ldi d=E1lka =ED t=F6flunni sj=E1lfri: 4
> D=E1lkur 1
> F=F6nky Exception: java.lang.NullPointerException: =
> java.lang.NullPointerException:
>         at = org.postgresql.Connection.ExecSQL(Connection.java:312)
>         at = org.postgresql.Field.getSQLType(Field.java:79)
>         at<= /FONT>
> org.postgresql.jdbc2.ResultSetMetaData.getColumnTyp= e(ResultSet
> MetaData.java:
> 363)
>         at =
> com.margmidlun.LIN.Upplysingakerfi.Importer.go(Impo= rter.java:132)
>
>         at = Gagnagaur.main(Gagnagaur.java:13)
> D=E1lkur 2
> F=F6nky Exception: java.lang.NullPointerException: =
> java.lang.NullPointerException:
>         at = org.postgresql.Connection.ExecSQL(Connection.java:312)
>         at = org.postgresql.Field.getSQLType(Field.java:79)
>         at<= /FONT>
> org.postgresql.jdbc2.ResultSetMetaData.getColumnTyp= e(ResultSet
> MetaData.java:
> 363)
>         at =
> com.margmidlun.LIN.Upplysingakerfi.Importer.go(Impo= rter.java:132)
>
>         at = Gagnagaur.main(Gagnagaur.java:13)
> D=E1lkur 3
> F=F6nky Exception: java.lang.NullPointerException: =
> java.lang.NullPointerException:
>         at = org.postgresql.Connection.ExecSQL(Connection.java:312)
>         at = org.postgresql.Field.getSQLType(Field.java:79)
>         at<= /FONT>
> org.postgresql.jdbc2.ResultSetMetaData.getColumnTyp= e(ResultSet
> MetaData.java:
> 363)
>         at =
> com.margmidlun.LIN.Upplysingakerfi.Importer.go(Impo= rter.java:132)
>
>         at = Gagnagaur.main(Gagnagaur.java:13)
> D=E1lkur 4
> F=F6nky Exception: java.lang.NullPointerException: =
> java.lang.NullPointerException:
>         at = org.postgresql.Connection.ExecSQL(Connection.java:312)
>         at = org.postgresql.Field.getSQLType(Field.java:79)
>         at<= /FONT>
> org.postgresql.jdbc2.ResultSetMetaData.getColumnTyp= e(ResultSet
> MetaData.java:
> 363)
>         at =
> com.margmidlun.LIN.Upplysingakerfi.Importer.go(Impo= rter.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 &q= uot;1.2.2"
>       Classic VM (bui= ld 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-serv= er-7.0.2-2
>       postgresql-deve= l-7.0.2-2
>     Sun JDK
>
>
>
> Now.... do you have any tips ?
>
>
> Regards,
> Tolli
> tolli@margmidlun.is
>

------_=_NextPart_001_01BFF18A.44A1B510--