DatabaseMetaData patch

Started by Liam Stewartalmost 25 years ago5 messagespatches
Jump to latest
#1Liam Stewart
liams@redhat.com

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

Attachments:

dbmetatdata.difftext/plain; charset=us-asciiDownload+48-28
#2Rene Pijlman
rpijlman@wanadoo.nl
In reply to: Liam Stewart (#1)
Re: DatabaseMetaData patch

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

#3Liam Stewart
liams@redhat.com
In reply to: Rene Pijlman (#2)
Re: DatabaseMetaData patch

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

Attachments:

dbmetatdata.difftext/plain; charset=iso-8859-1Download+50-28
#4Bruce Momjian
bruce@momjian.us
In reply to: Liam Stewart (#3)
Re: DatabaseMetaData patch

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
#5Bruce Momjian
bruce@momjian.us
In reply to: Liam Stewart (#3)
Re: DatabaseMetaData patch

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