ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paweł Gutowski <pawel.gutow...@gmail.com>
Subject iBatis with MySQL and UTF-8 encoding
Date Thu, 19 Mar 2009 22:00:32 GMT
Hi,
I have a problem with writing special characters to database (such as
polish letters).
Every special character is magically replaced by question-mark char:
"?" (HEX: 3F)
Reading works correctly: If I'm writing special characters throgh
MySQL Query Browser than my application is reading them correctly.

Tables in database (MySQL) are configured to store UTF-8 characters.

I'm putting right String to SQLMAP - as you can see in the log below
(name="Paweł").

[2009-03-19 22:39:51,356] [http-8080-6] [DEBUG] java.sql.Connection
--- {conn-100043} Preparing Statement:   INSERT INTO users   (`id`,
`login`, `private_pass`, `public_pass`, `name`, `last_name`, `email`,
`registration_date`)  VALUES   (?, ?, ?, ?, ?, ?, ?, ?)
[2009-03-19 22:39:51,394] [http-8080-6] [DEBUG]
java.sql.PreparedStatement --- {pstm-100044} Executing Statement:
INSERT INTO users   (`id`, `login`, `private_pass`, `public_pass`,
`name`, `last_name`, `email`, `registration_date`)  VALUES   (?, ?, ?,
?, ?, ?, ?, ?)
[2009-03-19 22:39:51,394] [http-8080-6] [DEBUG]
java.sql.PreparedStatement --- {pstm-100044} Parameters: [0, sss,
ssssssss, , Paweł, asdf, asdf@asdf.pl, 2009-03-19]
[2009-03-19 22:39:51,394] [http-8080-6] [DEBUG]
java.sql.PreparedStatement --- {pstm-100044} Types:
[java.lang.Integer, java.lang.String, java.lang.String,
java.lang.String, java.lang.String, java.lang.String,
java.lang.String, java.lang.String]


My configuration is:
iBatis: 2.3.4
MySQL 5.0.67-0ubuntu6
mysql-connector-java-5.1.7

What could be wrong?

Mime
View raw message