Re: setting connection character set
Posted by: Thomas Taylor
Date: February 20, 2006 07:18PM

As per the MySQL/Connector/J manual, you can't use the 'SET NAMES' command after you've created your initial JDBC connection, the Connector/J driver does not receive this 'update'.

The recommended way to set the connection character set is through the JDBC connection URL. This is done by adding 'characterEncoding=<charset>' to your JDBC URL.

Example:
String URL = "jdbc:mysql://localhost/MyDatabase&characterEncoding=UTF-8";

Connection connection = DriverManager.getConnection(URL);

Options: ReplyQuote


Subject
Views
Written By
Posted
3089
December 04, 2005 07:21AM
Re: setting connection character set
8031
February 20, 2006 07:18PM


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.