Like operator and cyrillic symbols with MySQL and jdbc
Posted by: Arthur Harkivskyi
Date: March 29, 2015 08:12AM

Hi to all! Why my select via JDBC is going like this? http://cs621724.vk.me/v621724427/19ade/rqgKgpzZPbU.jpg

create table b(tt varchar(2));
insert into b select 'ы ';
SELECT * FROM allservices.b;
result from Workbench is # tt 'ы' But with jdbc...

connection = initConnection();
statement = connection.prepareCall("select tt from b where tt like '%ы%'");
resultSet = statement.executeQuery();
System.out.println("----------");
while (resultSet.next()) {
System.out.println(resultSet.getString("tt"));
}
System.out.println("==========");
statement = connection.prepareCall("select tt from b where tt like '%'");
resultSet = statement.executeQuery();
System.out.println("----------");
while (resultSet.next()) {
System.out.println(resultSet.getString("tt"));
}
System.out.println("==========");
result is: ---------- ========== ---------- ы ==========

Options: ReplyQuote


Subject
Views
Written By
Posted
Like operator and cyrillic symbols with MySQL and jdbc
3033
March 29, 2015 08:12AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.