Re: [sorry] trying to connect gives :sun.io.CharToByteUTF-8 Exception

From: "Cristina Surroca" <cris(at)dmcid(dot)net>
To: "Cristina Surroca" <cris(at)dmcid(dot)net>, <pgsql-jdbc(at)postgresql(dot)org>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: [sorry] trying to connect gives :sun.io.CharToByteUTF-8 Exception
Date: 2003-04-14 20:53:55
Message-ID: 05f501c302c7$f9ecd0a0$3031393e@cris
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-jdbc

Sorry, Now I know which the problem was: my java version

excuse me
yours

cris..
----- Original MessSage -----
From: Cristina Surroca
To: pgsql-jdbc(at)postgresql(dot)org
Cc: pgsql-general(at)postgresql(dot)org
Sent: Monday, April 14, 2003 8:51 PM
Subject: [GENERAL] trying to connect gives :sun.io.CharToByteUTF-8 Exception

Hi,
I've working with postgreSQL and JDBC. I've made some proves and all has gone ok. But now, I've to do in other machine.
There is Postgresql 7.3.2, with ant. I've the in CLASSPATH the jar file.
But when I tried to run the code there is thrown a exception when it try to getConnection:

Something unusual has occured to cause the driver to fail. Please report this
exception: Exception: java.lang IllegalArgumentException: sun.io.CharToByteUTF-8 ...."

The thing it's that the same code works in other matchine, and I'm not able to find the error.
I've been looking for it, but I haven't got any result.

Does anybody know where is my fault?

Thanks a lot,

yours

Cris..

/*------------------------------------------------------------------------------------------------------------------------------------------------------*/
import java.sql.*;

class CtrlDatMartes
{
private static Connection conn;

public boolean RealizarConexion() throws Exception
{
boolean conectat = false;
if(ActivacioDrivers())
{
try
{
conn = DriverManager.getConnection("jdbc:postgresql://localhost/cris","postgres","XXXX"); // <- Here my fault must be, but it should work, shouldn't it????
conectat = true;
}
catch(SQLException sqlex)
{
System.out.println("Cach");
System.out.println(sqlex.getErrorCode());
throw (new Exception(String.valueOf(sqlex.getMessage())));
}

}
return conectat;
}
private boolean ActivacioDrivers() throws Exception
{
boolean activat = false;

try
{
Class.forName("org.postgresql.Driver");
activat = true;
}
catch(ClassNotFoundException ex)
{
throw (new Exception("[???:] Error en l'activació dels DRIVERS."));
}
return activat;
}

}
/*------------------------------------------------------------------------------------------------------------------------------------------------------*/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Vilson farias 2003-04-14 21:34:33 Help using pgfsck
Previous Message Lamar Owen 2003-04-14 20:51:32 Re: Upgrade to RedHat 9.0 broke PostgreSQL

Browse pgsql-jdbc by date

  From Date Subject
Next Message snpe 2003-04-14 22:31:26 JDBC driver without URL
Previous Message Cristina Surroca 2003-04-14 18:51:10 trying to connect gives :sun.io.CharToByteUTF-8 Exception