Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> scrambled exception message using OCI
Hi there,
I'm trying to connect to an Oracle 9i db from a linux box using OCI drivers, and I get an SQLException with an unreadable message.
I use a very simple test class, which does :
Class driverClass = Class.forName("oracle.jdbc.driver.OracleDriver");
DriverManager.getConnection("jdbc:oracle:oci8:@MYSERVICENAME",The MYSERVICENAME is defined in the tnsnames.ora file. I tried to connect to an oracle instance on the same machine, on a remote machine, with JDK1.4, 1.3, it always fails with a message like :
"MYUSERNAME",
"MYPASSWORD");
This is run on a linux box that has Oracle9i installed.
java.sql.SQLException: <a bunch of weird characters which cannot even be displayed within a newsgroup>
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180) at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java:1759) at oracle.jdbc.oci8.OCIEnv.getEnvHandle(OCIEnv.java:69) at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:452) at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:287) at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:442) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:321) at java.sql.DriverManager.getConnection(DriverManager.java:512) at java.sql.DriverManager.getConnection(DriverManager.java:172) at MyTest.main(OracleTest.java:37)
Using the thin driver works.
Using sqlplus works.
The error message seems to be deterministic, i.e. if I set a wrong password, i will get another message, but for the same set of parameters, i always get the same message. It looks to me like the OCI client layer has its language/characterset misconfigured, but I tried to change the java default Locale, the NLS_LANG env parameter under oracle user, and it has no effect.
Any idea ?
Thx,
P. Received on Fri Feb 07 2003 - 05:22:33 CST