Euro sign not displayed properly when fetched from DB

R

Raga

Hi,

I stored the euro sign (€ ) (press alt+0 1 2 8 on Windows to get that
sign) in an Oracle database table in varchar2 type column. when I do
'select * from table_euro;', I get the euro sign displayed properly in
SQL prompt.

SQL> select * from table_euro
2 /

NAME
--------------------




Now, I programatically read it using Java Resultset object, but it
displays as Ç (which is Alt + 1 2 8 in key press). This' how I fetch
it programmatically:

dbStatement = dbCon.createStatement(ResultSet.TYPE_FORWARD_ONLY,
ResultSet.CONCUR_READ_ONLY);
dbDataReader = dbStatement.executeQuery(query);
.....
while(until result set is read fully)
{
Object fieldData = dbDataReader.getObject(fieldIndex);
System.out.println(fieldData);
}


For the euro sign, the above prints Ç . Why is that? Can anyone please
throw some light on it?


Thanks.
 
M

Michael Rauscher

Raga said:
Hi,

I stored the euro sign (€ ) (press alt+0 1 2 8 on Windows to get that
sign) in an Oracle database table in varchar2 type column. when I do
'select * from table_euro;', I get the euro sign displayed properly in
SQL prompt.

In which application did you store it?
For the euro sign, the above prints Ç . Why is that? Can anyone please
throw some light on it?

It's due to wrong character set conversion, I guess.

Bye
Michael
 
S

Simon Brooke

Raga said:
Hi,

I stored the euro sign (€ ) (press alt+0 1 2 8 on Windows to get that
sign) in an Oracle database table in varchar2 type column. when I do
'select * from table_euro;', I get the euro sign displayed properly in
SQL prompt.

This is an Oracle problem, not a Java problem. Ask it in an Oracle group.

But, as a hint, your answer will probably be 'UTF8'
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top