Thread: post

post

From
"Andrey Kikhtenko"
Date:

Hi,

 

I have postgreSQL database (server & database encoding - utf-8. Version - 8.3)

I've created the login with the Cyrilic symbols (f.e. "Иванов").

When I'm tryin' to connect using JDBC I'm receving the exception:

{code}

org.postgresql.util.PSQLException: FATAL: password authentication failed for user "??????"

         at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:276)

         at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:95)

         at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)

         at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:124)

         at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)

         at org.postgresql.jdbc3.Jdbc3Connection.<init>(Jdbc3Connection.java:24)

         at org.postgresql.Driver.makeConnection(Driver.java:386)

         at org.postgresql.Driver.connect(Driver.java:260)

         at java.sql.DriverManager.getConnection(Unknown Source)

         at java.sql.DriverManager.getConnection(Unknown Source)

{code}

 

My code is:

{code}

Properties connectionProperties = new Properties();

                   connectionProperties.setProperty("user", userName);

                   connectionProperties.put("charSet", "utf-8");

                   connectionProperties.setProperty("password", userPassword);

                   try {

                   connection = DriverManager.getConnection(connectionString, connectionProperties);

                   } catch (SQLException e) {

                            e.printStackTrace();

                   }{code}

 

When I'm tryin' to connect using UTF-8 decoded name: Р?ванов I'm receiving the same exception, but another client tool (EMS SQL Manager) works with second login.

 

Can some body tell me what's wrong?

 

Thanks, Andrew.

 

 

Best regards,


Andrew Kikhtenko

Developer

TERRASOFT

Direct phone:  +380 444 962 450

E-mail: A.Kikhtenko@tscrm.com

www.tscrm.com

 

cid:image001.jpg@01C6DD9D.A8EDD280

 

 

Attachment

Re: post

From
Kris Jurka
Date:

On Tue, 30 Sep 2008, Andrey Kikhtenko wrote:

> I have postgreSQL database (server & database encoding - utf-8. Version
> - 8.3)
>
> I've created the login with the Cyrilic symbols (f.e. "������").
>
> When I'm tryin' to connect using JDBC I'm receving the exception:
>
> {code}
>
> org.postgresql.util.PSQLException: FATAL: password authentication failed
> for user "??????"
>

The initial connection setup with the server does not have a well defined
encoding so the only thing that is guaranteed to work is plain ASCII.  Up
until a week ago, the JDBC driver always sent the username as ASCII so it
wouldn't work.  Last week it was changed to use UTF-8, so now some more
cases should work (including yours).  You'll need to build the driver from
CVS, or you can try this one:

http://ejurka.com/pgsql/jars/ak/

Kris Jurka