Re: About a JDBC error

From: <zhang-x(at)cnt(dot)mxy(dot)nes(dot)nec(dot)co(dot)jp>
To: "Oliver Jowett" <oliver(at)opencloud(dot)com>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: About a JDBC error
Date: 2004-04-09 06:00:20
Message-ID: 00ad01c41df7$f0a2b860$f35610ac@ichigo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc


> so if your driver is older than that, it may be the problem.
I use the JDBC drive in package : postgresql-jdbc-7.4.1-1PGDG.i386.rpm.
And I user md5 in pg_hba.conf.
I think my default encoding is EUC-JP.

Do you think if I update my JDBC Driver , the error will go away?
This problem is so difficult to me. (-_-)b

>
> What version of the driver are you using? I see this in the CVS logs:
>
> > ----------------------------
> > revision 1.31
> > date: 2004/02/10 01:56:46; author: jurka; state: Exp; lines: +14 -6
> > Don't try to turn the random bytes from a md5 salt into a String
> > because it may not be a valid String depending on the encoding.
> >
> > Per report from Nadeem Bitar.
> > ----------------------------
>
> so if your driver is older than that, it may be the problem.
>
> Failing that, are you using crypt-based authentication? ("crypt" in the
> appropriate access line in pg_hba.conf). From a quick glance at the code
> it looks like the crypt salt suffers from the same problem as md5 used
> to -- it tries to turn a couple of bytes into a String using the default
> encoding, which will not work reliably. As a temporary workaround, try
> changing pg_hba.conf to use "md5" instead of "crypt".
>
> If you use a different default encoding such as ISO-8859-1 (IIRC you can
> do this by setting the file.encoding system property, i.e.
> -Dfile.encoding=ISO-8859-1) does the problem go away?
>
> > ----------------err----------------------
> > DBAccess.getConnection(): Something unusual has occured to cause the
driver
> > to fail. Please report this exception: Exception:
> > java.lang.IllegalArgumentException
> > Stack Trace:
> >
> > java.lang.IllegalArgumentException
> > at java.nio.Buffer.position(Buffer.java:218)
> > at java.nio.charset.CharsetDecoder.decode(CharsetDecoder.java:575)
> > at java.lang.StringCoding$CharsetSD.decode(StringCoding.java:186)
> > at java.lang.StringCoding.decode(StringCoding.java:224)
> > at java.lang.StringCoding.decode(StringCoding.java:230)
> > at java.lang.String.<init>(String.java:371)
> > at
> >
org.postgresql.jdbc1.AbstractJdbc1Connection.openConnectionV2(AbstractJdbc1C
> > onnection.java:634)
>
> -O
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
> joining column's datatypes do not match

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2004-04-09 06:25:35 Re: About a JDBC error
Previous Message Oliver Jowett 2004-04-09 05:38:33 Re: About a JDBC error