Thread: DatabaseMetaData patch

DatabaseMetaData patch

From
Liam Stewart
Date:
Here is a small patch for the DatabaseMetaData class (both jdbc1 and
jdbc2) that gets the unimplemented methods that should return a
ResultSet to throw an SQLException -- correct according the JDBC API.
They used to return null. Also the getTypeInfo method will throw an
SQLException if the ExecSQL call returns null.

Liam

--
Liam Stewart :: Red Hat Canada, Ltd. :: liams@redhat.com

Attachment

Re: DatabaseMetaData patch

From
Rene Pijlman
Date:
On Fri, 17 Aug 2001 15:59:38 -0400, you wrote:
>Here is a small patch for the DatabaseMetaData class (both jdbc1 and
>jdbc2) that gets the unimplemented methods that should return a
>ResultSet to throw an SQLException -- correct according the JDBC API.
>They used to return null.

Looks good. Fix in 7.2 documented on
http://lab.applinet.nl/postgresql-jdbc/#DatabaseMetaData (work
in progress).

>Also the getTypeInfo method will throw an
>SQLException if the ExecSQL call returns null.

Shouldn't

   throw new PSQLException("metadata unavailable");

in getTypeInfo() be something like:

   throw new PSQLException("postgresql.meta.unavailable");

to allow translation of the error message in the
errors*.properties files?

Regards,
René Pijlman

Re: DatabaseMetaData patch

From
Liam Stewart
Date:
On Fri, Aug 17, 2001 at 11:17:45PM +0200, Rene Pijlman wrote:
>
> Shouldn't
>
>    throw new PSQLException("metadata unavailable");
>
> in getTypeInfo() be something like:
>
>    throw new PSQLException("postgresql.meta.unavailable");
>
> to allow translation of the error message in the
> errors*.properties files?

You're right. Attached is an updated patch that also includes a message
in error.properties. I've attempted a French message in
errors_fr.properties but beware that I haven't written French in quite a
few years. Don't know Italian, German, or Dutch so I can't do those.

Liam

--
Liam Stewart :: Red Hat Canada, Ltd. :: liams@redhat.com

Attachment

Re: DatabaseMetaData patch

From
Bruce Momjian
Date:
Your patch has been added to the PostgreSQL unapplied patches list at:

    http://candle.pha.pa.us/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

> On Fri, Aug 17, 2001 at 11:17:45PM +0200, Rene Pijlman wrote:
> >
> > Shouldn't
> >
> >    throw new PSQLException("metadata unavailable");
> >
> > in getTypeInfo() be something like:
> >
> >    throw new PSQLException("postgresql.meta.unavailable");
> >
> > to allow translation of the error message in the
> > errors*.properties files?
>
> You're right. Attached is an updated patch that also includes a message
> in error.properties. I've attempted a French message in
> errors_fr.properties but beware that I haven't written French in quite a
> few years. Don't know Italian, German, or Dutch so I can't do those.
>
> Liam
>
> --
> Liam Stewart :: Red Hat Canada, Ltd. :: liams@redhat.com

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://www.postgresql.org/search.mpl

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Re: DatabaseMetaData patch

From
Bruce Momjian
Date:
Patch applied.  Thanks.

> On Fri, Aug 17, 2001 at 11:17:45PM +0200, Rene Pijlman wrote:
> >
> > Shouldn't
> >
> >    throw new PSQLException("metadata unavailable");
> >
> > in getTypeInfo() be something like:
> >
> >    throw new PSQLException("postgresql.meta.unavailable");
> >
> > to allow translation of the error message in the
> > errors*.properties files?
>
> You're right. Attached is an updated patch that also includes a message
> in error.properties. I've attempted a French message in
> errors_fr.properties but beware that I haven't written French in quite a
> few years. Don't know Italian, German, or Dutch so I can't do those.
>
> Liam
>
> --
> Liam Stewart :: Red Hat Canada, Ltd. :: liams@redhat.com

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://www.postgresql.org/search.mpl

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026