No ascii characters from java
Posted by: michael Mauro
Date: January 16, 2017 05:39AM

Hi all,

i'm working on a java software communicating with a mysql db.

The java software is using the default character encoding, i have some troubles when i have to do queries on db with spanish characters (as Ñ).

From the java code i call a stored procedure and i give as parameter the string that has to be used in the research on db.

The issue comes out when i use spanish characters because java translates them in hexadecimal values and put this value as string in the query (Using a simple setString() on a CallableStatement).

So instead do a query with Ñ% as parameter i have a query with C391%.

Is there a way to fix this problem from db side?

ps:

I'm using mysql 5.5 and the mysql library for java is "mysql-connector-5.1.38.jar"

Thanks in advance

Options: ReplyQuote


Subject
Views
Written By
Posted
No ascii characters from java
1469
January 16, 2017 05:39AM
667
January 16, 2017 09:30AM
677
January 19, 2017 07:41AM


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.