You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by startxxx <ju...@u812.net> on 2007/09/16 03:40:34 UTC

Trying to insert hebrew text, mysql stores ??? instead

I am trying to insert hebrew text with iBatis and the db (mysql) stores ???
instead. Changing the db value to hebrew proves that my iBatis setup can
read hebrew (select) with no problems, the problem is only with inserts. Any
clue where I should be looking now?...
-- 
View this message in context: http://www.nabble.com/Trying-to-insert-hebrew-text%2C-mysql-stores-----instead-tf4449744.html#a12695809
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Re: Trying to insert hebrew text, mysql stores ??? instead

Posted by maomaode <ma...@gmail.com>.
Hi,

What's your JDK version, What's your mysql-conn version,  What's your 
mysql version?
It's not a problem in ibatis, i guess.

I guess, the problem is in the version of mysql-conn, I would suggest 
the mysql-conn 3.0.10, as i found that the upper version is not working 
at all with the charset.
But the latest version is faster than the older version.

I have not found the reason, I post a question into the mysql-conn  
forum, but haven't got the answer yet.

And try your native charset, not the utf-8 with the mysql-conn 3.0.10

Let me know if it works for you?

Regards,
James

> On Sun, 16 Sep 2007, startxxx wrote:
>
>>
>> my database tables are set utf8
>> netbeans debugger shows me the hebrew value of the string fine
>> one line before i insert it using iBatis.
>>
>> anything else?
>
> Set characterEncoding=utf8 on the connection URL but it's not an 
> iBatis issue.
>

Re: Trying to insert hebrew text, mysql stores ??? instead

Posted by Graeme J Sweeney <ib...@gjsweeney.com>.
On Sun, 16 Sep 2007, startxxx wrote:

>
> my database tables are set utf8
> netbeans debugger shows me the hebrew value of the string fine
> one line before i insert it using iBatis.
>
> anything else?

Set characterEncoding=utf8 on the connection URL but it's not an iBatis issue.

-- 
Graeme -

Re: Trying to insert hebrew text, mysql stores ??? instead

Posted by Richard Yee <ry...@cruzio.com>.
There are no language settings for iBATIS. I suggest writing a test 
application that uses JDBC to insert into the database. I think you will 
find the same results as you are getting with iBATIS now. This would 
then mean that you need to look at the documentation for MySQL and 
configure it so that it knows that the character set you are sending 
using JDBC is Hebrew. Just because it is working with the mysql command 
line tool, doesn't mean it going to work the same with JDBC.

-Richard


startxxx wrote:
> my database tables are set utf8
> netbeans debugger shows me the hebrew value of the string fine
> one line before i insert it using iBatis.
>
> anything else?
>
>
> Graeme J Sweeney wrote:
>   
>> On Sun, 16 Sep 2007, startxxx wrote:
>>
>>     
>>> The database seem to hold hebrew text if I add it using the mysql query
>>> browser and the hebrew
>>> values show fine when selected from my application using iBatis - so I
>>> have
>>> all reasons
>>> to believe it's not a mysql setup issue (unless I'm missing something in
>>> between the lines)..
>>>       
>> Assuming the database character set is 'hebrew' and not 'utf8', have 
>> you encoded the content correctly prior to inserting it?
>>
>> See java.lang.String(byte[] bytes, String charsetName)
>>
>> -- 
>> Graeme -
>>
>>
>>     
>
>   


Re: Trying to insert hebrew text, mysql stores ??? instead

Posted by startxxx <ju...@u812.net>.
my database tables are set utf8
netbeans debugger shows me the hebrew value of the string fine
one line before i insert it using iBatis.

anything else?


Graeme J Sweeney wrote:
> 
> On Sun, 16 Sep 2007, startxxx wrote:
> 
>> The database seem to hold hebrew text if I add it using the mysql query
>> browser and the hebrew
>> values show fine when selected from my application using iBatis - so I
>> have
>> all reasons
>> to believe it's not a mysql setup issue (unless I'm missing something in
>> between the lines)..
> 
> Assuming the database character set is 'hebrew' and not 'utf8', have 
> you encoded the content correctly prior to inserting it?
> 
> See java.lang.String(byte[] bytes, String charsetName)
> 
> -- 
> Graeme -
> 
> 

-- 
View this message in context: http://www.nabble.com/Trying-to-insert-hebrew-text%2C-mysql-stores-----instead-tf4449744.html#a12724076
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Re: Trying to insert hebrew text, mysql stores ??? instead

Posted by Graeme J Sweeney <ib...@gjsweeney.com>.
On Sun, 16 Sep 2007, startxxx wrote:

> The database seem to hold hebrew text if I add it using the mysql query
> browser and the hebrew
> values show fine when selected from my application using iBatis - so I have
> all reasons
> to believe it's not a mysql setup issue (unless I'm missing something in
> between the lines)..

Assuming the database character set is 'hebrew' and not 'utf8', have 
you encoded the content correctly prior to inserting it?

See java.lang.String(byte[] bytes, String charsetName)

-- 
Graeme -

Re: Trying to insert hebrew text, mysql stores ??? instead

Posted by startxxx <ju...@u812.net>.
The database seem to hold hebrew text if I add it using the mysql query
browser and the hebrew
values show fine when selected from my application using iBatis - so I have
all reasons
to believe it's not a mysql setup issue (unless I'm missing something in
between the lines)..



Richard Yee wrote:
> 
> Did you set up Hebrew as the server charset for mySQL? Did you create 
> the table and specify hebrew as the character_set. Have you read section 
> 10.4 of the MySQL Reference Manual (Connection Character Sets and 
> Collations (ver. 5.1))
> 
> -Richard
> 
> 
> startxxx wrote:
>> I am trying to insert hebrew text with iBatis and the db (mysql) stores
>> ???
>> instead. Changing the db value to hebrew proves that my iBatis setup can
>> read hebrew (select) with no problems, the problem is only with inserts.
>> Any
>> clue where I should be looking now?...
>>   
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Trying-to-insert-hebrew-text%2C-mysql-stores-----instead-tf4449744.html#a12697634
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Re: Trying to insert hebrew text, mysql stores ??? instead

Posted by Richard Yee <ry...@cruzio.com>.
Did you set up Hebrew as the server charset for mySQL? Did you create 
the table and specify hebrew as the character_set. Have you read section 
10.4 of the MySQL Reference Manual (Connection Character Sets and 
Collations (ver. 5.1))

-Richard


startxxx wrote:
> I am trying to insert hebrew text with iBatis and the db (mysql) stores ???
> instead. Changing the db value to hebrew proves that my iBatis setup can
> read hebrew (select) with no problems, the problem is only with inserts. Any
> clue where I should be looking now?...
>   


Re: Trying to insert hebrew text, mysql stores ??? instead

Posted by startxxx <ju...@u812.net>.
Problem solved.

I have upgraded MySQL's  ConnectorJ driver from 5.0.5 to 5.1.5 and i got
everything working great.

thanks.


startxxx wrote:
> 
> I am trying to insert hebrew text with iBatis and the db (mysql) stores
> ??? instead. Changing the db value to hebrew proves that my iBatis setup
> can read hebrew (select) with no problems, the problem is only with
> inserts. Any clue where I should be looking now?...
> 

-- 
View this message in context: http://www.nabble.com/Trying-to-insert-hebrew-text%2C-mysql-stores-----instead-tf4449744.html#a13429547
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.