Re: DatabaseMetaData - getImportedKeys

From: Kris Jurka <books(at)ejurka(dot)com>
To: Aleksey <phone(at)ukr(dot)net>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: DatabaseMetaData - getImportedKeys
Date: 2003-11-04 15:03:51
Message-ID: Pine.LNX.4.33.0311041000001.10763-200000@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Tue, 4 Nov 2003, Kris Jurka wrote:

>
>
> On Mon, 3 Nov 2003, Aleksey wrote:
>
> > I have the following problem working with DatabaseMetaData.
> >
> > [ retreiving foreign key column names with KOI8-R characters fails
> > when trying to decodeUTF ]
>
> The way many DatabaseMetaData methods work is that they run a query to
> retrieve the necessary data which it then iterates over, reformats, and
> stores into an in memory ResultSet which is returned to the user. The in
> memory ResultSet is implemented with byte arrays, so all String data has
> .getBytes() called on it to turn it into a byte array. This turns it into
> a byte array with the JVM's default charset which may not be the UTF-8 we
> need. This is why the resulting decoding from UTF-8 is failing, because
> it is not actually UTF-8 data.
>
> The attached patch encodes the data into the format that the subsequent
> decoder expects. Aleksey, could you try out this patch or the pre-built
> jar file that includes it at http://www.ejurka.com/pgsql/ and confirm that
> this fixes your problem?
>
> Kris Jurka
>

Attached is a corrected patch. The original failed to compile after doing
a clean, but somehow I was able to build it earlier. Ant's dependency
tracking could apparently use some work.

Kris Jurka

Attachment Content-Type Size
metadataencoding_fix2.patch text/plain 18.4 KB

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Alessandro Polverini 2003-11-04 15:10:42 Re: automatic sequence number?
Previous Message Glenn Holmer 2003-11-04 15:03:20 Re: too many clients