You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Hinnerk Feldwisch <di...@yahoo.de> on 2003/06/13 22:09:04 UTC

Special Characters in use with MySQL

Hello,

I'm using OJB with the mm.mysql- driver (the latest stable release) to
store my objects in a mysql- database, which works quite fine; but I'm
having problems with special characters like the german umlaute
(äöüß). They are stored ok to data- fields with the type "VARCHAR",
but are mixed up when I use the mysql- type "TEXT" (and the jdbc- type
"LONGVARCHAR").

Where's the problem? Do I have to set the encoding up somewhere?

(OJB does retrieve the text and the special chars from the database
correctly, only the storing is a problem)

Thank you very much for any help,
Hinnerk


Re: Special Characters in use with MySQL

Posted by onno <on...@onnos.com>.
Hinnerk:

we had a similar issue with our mySQL - or an 'older' version (ie < 4.) and
not just for stuff like


dbalias="//localhost/dkitCareers?useUnicode=true&amp;characterEncoding=Cp125
2"

solved ALL unicode issues we had


----- Original Message -----
From: "Hinnerk Feldwisch" <di...@yahoo.de>
To: "OJB Users List" <oj...@db.apache.org>; "Hinnerk Feldwisch"
<di...@yahoo.de>
Sent: Saturday, June 14, 2003 3:41 PM
Subject: Re: Special Characters in use with MySQL


> Hello again,
>
> doesn't anyone have an idea for a sollution of my problem? Any hint?
> I tried to debug it, but didn't succeed to solve the core of the
> problem.
> And I forgot to mention that everything works fine without OJB, I can
> INSERT arbitrary Strings to the database when using direkt JDBC-
> statements...
>
> Thanks again,
> Hinnerk
>
> Friday, June 13, 2003, 10:09:04 PM, I wrote:
>
> > Hello,
>
> > I'm using OJB with the mm.mysql- driver (the latest stable release) to
> > store my objects in a mysql- database, which works quite fine; but I'm
> > having problems with special characters like the german umlaute
> > (äöüß). They are stored ok to data- fields with the type "VARCHAR",
> > but are mixed up when I use the mysql- type "TEXT" (and the jdbc- type
> > "LONGVARCHAR").
>
> > Where's the problem? Do I have to set the encoding up somewhere?
>
> > (OJB does retrieve the text and the special chars from the database
> > correctly, only the storing is a problem)
>
> > Thank you very much for any help,
> > Hinnerk
>
>
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>


Re: Special Characters in use with MySQL

Posted by Thomas Mahler <th...@web.de>.
Hello Hinnerk,

I'm no MySql expert, but this really sounds like a encoding or codepage 
problem.
AFAIK you can add encoding hints in the jdbc connect string. But I don't 
know the details.

an alternative solution could be to write a FieldConversion that provide 
a proper String to byte[] conversion. This converison can be implemented 
to use UTF-8 or any other codepage that knows all those german 
Überraschungen and Ärgernisse :-)

cheers,
Thomas

Hinnerk Feldwisch wrote:
> Hello again,
> 
> doesn't anyone have an idea for a sollution of my problem? Any hint?
> I tried to debug it, but didn't succeed to solve the core of the
> problem.
> And I forgot to mention that everything works fine without OJB, I can
> INSERT arbitrary Strings to the database when using direkt JDBC-
> statements...
> 
> Thanks again,
> Hinnerk
> 
> Friday, June 13, 2003, 10:09:04 PM, I wrote:
> 
> 
>>Hello,
> 
> 
>>I'm using OJB with the mm.mysql- driver (the latest stable release) to
>>store my objects in a mysql- database, which works quite fine; but I'm
>>having problems with special characters like the german umlaute
>>(äöüß). They are stored ok to data- fields with the type "VARCHAR",
>>but are mixed up when I use the mysql- type "TEXT" (and the jdbc- type
>>"LONGVARCHAR").
> 
> 
>>Where's the problem? Do I have to set the encoding up somewhere?
> 
> 
>>(OJB does retrieve the text and the special chars from the database
>>correctly, only the storing is a problem)
> 
> 
>>Thank you very much for any help,
>>Hinnerk
> 
> 
> 
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>>For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 


Re: Special Characters in use with MySQL

Posted by Hinnerk Feldwisch <di...@yahoo.de>.
Hello again,

doesn't anyone have an idea for a sollution of my problem? Any hint?
I tried to debug it, but didn't succeed to solve the core of the
problem.
And I forgot to mention that everything works fine without OJB, I can
INSERT arbitrary Strings to the database when using direkt JDBC-
statements...

Thanks again,
Hinnerk

Friday, June 13, 2003, 10:09:04 PM, I wrote:

> Hello,

> I'm using OJB with the mm.mysql- driver (the latest stable release) to
> store my objects in a mysql- database, which works quite fine; but I'm
> having problems with special characters like the german umlaute
> (äöüß). They are stored ok to data- fields with the type "VARCHAR",
> but are mixed up when I use the mysql- type "TEXT" (and the jdbc- type
> "LONGVARCHAR").

> Where's the problem? Do I have to set the encoding up somewhere?

> (OJB does retrieve the text and the special chars from the database
> correctly, only the storing is a problem)

> Thank you very much for any help,
> Hinnerk


> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org