Thread: Problems with jdbc thin driver (Euro Symbol)


Permlink Replies: 10 - Pages: 1 - Last Post: Oct 8, 2007 12:52 PM Last Post By: marmouton
Christian Marsch

Posts: 14
Registered: 08/21/07
Problems with jdbc thin driver (Euro Symbol)
Posted: Aug 21, 2007 8:41 AM
Click to report abuse...   Click to reply to this thread Reply
Hello,

at the moment it is impossible for me to write or read euro characters to a database using a jdbc thin driver.

I am using
ojdbc14.jar (version 10.2.0.3.0) and orai18n.jar (also) together with JDK 1.4.2.

Charset of the database is WE8MSWIN1252. It does not work on ORACLE 9.2.0.1, 9.2.0.6 and 10.2.0.2.0 (others I have not tried). But the problem seams to be in thin client.

Inserting Eurosymbols using a PreparedStatement works quite well. Using a normal Statement does not work.
Also the values getting from a ResultSet are incorrect.

After several test I downloaded a patch 4659157 for ojdbc14.jar and 5470375 for orai18n.jar. After installing the patch the euro characters were returned, but:
In several selects of numeric fields (not all, seams to be random) my resultset returned the Euro character instead of 0 and so on.

Driver for 9.2 works quite well, but does not support 10g Release 2 (and contains also some funny bugs)

Following solutions are not suitable for us:
Changing the character set of the database (come on, this cannot be serious. I cannot change the character set of more than 100 databases)
Using the newest driver (ORACLE 11). We are still using JAVA 1.4.2 and cannot migrate our application at the moment.
Using an oci client. Not possible, no ORACLE client on clients...

Has anyone an idea how to deal with this?
Does anyone know when ORACLE is going to release a new jdbc driver for JAVA 1.4.2 (maybe 10.2.0.4.) ??

Regards,

Christian

Chris Antognini

Posts: 1,039
Registered: 03/20/99
Re: Problems with jdbc thin driver (Euro Symbol)
Posted: Aug 21, 2007 9:17 AM   in response to: Christian Marsch in response to: Christian Marsch
Click to report abuse...   Click to reply to this thread Reply
Hi

Out of curiosity... If you create a simple table like "create table t (c varchar2(1))" and then insert only the euro char with something like:

sql = "INSERT INTO t VALUES ('" + '\u20ac' + "')";
statement = connection.createStatement();
statement.execute(sql);
statement.close();
connection.commit();

What does the query "select dump(c,16) from t" return? "Typ=1 Len=1: 80"?

Best,
Chris
Christian Marsch

Posts: 14
Registered: 08/21/07
Re: Problems with jdbc thin driver (Euro Symbol)
Posted: Aug 21, 2007 9:22 AM   in response to: Chris Antognini in response to: Chris Antognini
Click to report abuse...   Click to reply to this thread Reply
Hello,

the query returns
Typ=1 Len=1: ac

Regards,

Christian
Chris Antognini

Posts: 1,039
Registered: 03/20/99
Re: Problems with jdbc thin driver (Euro Symbol)
Posted: Aug 21, 2007 9:31 AM   in response to: Christian Marsch in response to: Christian Marsch
Click to report abuse...   Click to reply to this thread Reply
Then you insert wrong data...

JFYI: In my 10.2.0.3 db with JDK 1.4.2 and ojdbc14.jar (10.2.0.3) it works without problems.
Christian Marsch

Posts: 14
Registered: 08/21/07
Re: Problems with jdbc thin driver (Euro Symbol)
Posted: Aug 21, 2007 9:35 AM   in response to: Chris Antognini in response to: Chris Antognini
Click to report abuse...   Click to reply to this thread Reply
When inserting data from an oci-client I get
Typ=1 Len=1: 80

€€But character is not displayed correctly. Are you using a thin client? What is the charset of your db? WE8MSWIN1252?
Chris Antognini

Posts: 1,039
Registered: 03/20/99
Re: Problems with jdbc thin driver (Euro Symbol)
Posted: Aug 21, 2007 9:41 AM   in response to: Christian Marsch in response to: Christian Marsch
Click to report abuse...   Click to reply to this thread Reply
When inserting data from an oci-client I get
Typ=1 Len=1: 80

According to http://download.oracle.com/docs/cd/B19306_01/server.102/b14225/applocaledata.htm#sthref1971 it is correct.

€€But character is not displayed correctly.

Display depends on the SQL*Plus (or the client you are using) settings. Either the font don't support the euro char or the client character set is wrongly set.

Are you using a thin client?

I tried with both (OCI and thin). No problem.

What is the charset of your db? WE8MSWIN1252?

No. WE8ISO8859P15.
Christian Marsch

Posts: 14
Registered: 08/21/07
Re: Problems with jdbc thin driver (Euro Symbol)
Posted: Aug 21, 2007 9:57 AM   in response to: Chris Antognini in response to: Chris Antognini
Click to report abuse...   Click to reply to this thread Reply
I know the correct form and it is clear to me that the inserted data is already wrong.

The font and the client charset seams to be correct. When I am using the same preferences (font and charset) with ORACLE 9.2 THIN driver I get a correct result.

The OCI driver works well, only the thin driver seams to have some problems.
Chris Antognini

Posts: 1,039
Registered: 03/20/99
Re: Problems with jdbc thin driver (Euro Symbol)
Posted: Aug 21, 2007 10:04 AM   in response to: Christian Marsch in response to: Christian Marsch
Click to report abuse...   Click to reply to this thread Reply
IMHO it's time to open an SR... Good luck.
Christian Marsch

Posts: 14
Registered: 08/21/07
Re: Problems with jdbc thin driver (Euro Symbol)
Posted: Aug 22, 2007 3:55 AM   in response to: Chris Antognini in response to: Chris Antognini
Click to report abuse...   Click to reply to this thread Reply
Just installed PATCH 4659157 and 5470375 from metalink. The Euro problem seams to be corrected.

BUT:
Another problem occurred. Sometimes numeric values are returned wrong (0 from a numeric field comes as euro, 1 comes as Á (2 and 3 too).

This error seams to be random to me.

Our application is selecting a rowid from a table and after that fills several textfields in a frame by selecting the content in a way like this:

select column1 from table where rowid=rowid
select column2 from table where rowid=rowid
...

if I select the numeric column with select nr. 77 I get a wrong value. If I select it at nr. 10 I get the correct value.

The selects are done by a normal Statement object creating a ResultSet. The Value from the ResultSet is fetched by getObject() method.

I also tried to write a test program executing only the selects of the application, but it gives me correct results.
Also when selecting all the fields in one select I get a correct result.

Using a different charset than WE8MSWIN1252 seams to give correct results. Using the OCI driver returns correct results.

Using ojdbc14.jar and orai18n.jar Release 10.2.0.3. unpatched produces the same error (and does not return Euro symbols)

Using ojdbc14.jar and orai18n.jar Release 10.2.0.2. returns correct results (but wrong Euro)

Has anyone had the same problem yet?

Regards,

Christian
Ashok Shivarudr...

Posts: 86
Registered: 01/10/01
Re: Problems with jdbc thin driver (Euro Symbol)
Posted: Aug 22, 2007 7:18 AM   in response to: Christian Marsch in response to: Christian Marsch
Click to report abuse...   Click to reply to this thread Reply
Christian,

Could you come up with a test case and file a bug for the same if it is constantly reproducible.

regards,
Ashok
marmouton

Posts: 3
Registered: 10/08/07
Re: Problems with jdbc thin driver (Euro Symbol)
Posted: Oct 8, 2007 12:52 PM   in response to: Ashok Shivarudr... in response to: Ashok Shivarudr...
Click to report abuse...   Click to reply to this thread Reply
Please have a look to Note 365874.1 on Metalink. You seems facing bug 5158739, which requires JDBC Driver 10.2.0.3.0 to be patched (apply patches 4659157 for ojdbc14.jar and 5470375 for orai18n.jar)
Legend
Guru Guru : 2500 - 1000000 pts
Expert Expert : 1000 - 2499 pts
Pro Pro : 500 - 999 pts
Journeyman Journeyman : 200 - 499 pts
Newbie Newbie : 0 - 199 pts
Oracle ACE Director
Oracle ACE Member
Oracle Employee ACE
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums