Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8344557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:24:34+00:00 2026-06-09T06:24:34+00:00

I have a problem to insert Japanese characters with my Java application in MySQL.

  • 0

I have a problem to insert Japanese characters with my Java application in MySQL.
If I insert this string “今日は”, I get this “???”.

My table and it’s fields uses UTF-8.
I don’t think that the table structure is involved, because while I insert the same string from PHP, it works.

CREATE TABLE `pool` (
  `id` int(8) NOT NULL AUTO_INCREMENT, 
  `message` varchar(160) COLLATE utf8_bin NOT NULL DEFAULT ''
  PRIMARY KEY (`id`),
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

I’m connecting to the databose with the lib “BoneCPConfig” who manage for me a pool of connexion :

Class.forName("com.mysql.jdbc.Driver");

Properties props = new Properties();
props.setProperty("characterEncoding", "UTF-8");
props.setProperty("useUnicode", "true");

BoneCPConfig config = new BoneCPConfig(props);
config.setJdbcUrl("jdbc:mysql://" + MYSQL_HOST_NAME + "/" + MYSQL_BASE_NAME);
config.setMinConnectionsPerPartition(MIN_CONNEXION_PER_PARTITION); 
config.setPartitionCount(PARTITION_COUNT); 
config.setUsername(MYSQL_LOGIN);
config.setPassword(MYSQL_PASSWORD);

I do my insert like this :

String query = "INSERT INTO pool (message) VALUES(?) ";

PreparedStatement insertStatement = connection.prepareStatement(query, Statement.RETURN_GENERATED_KEYS);
insertStatement.setString(1, "今日は");
insertStatement.execute();

I think my problem is in the connexion configuration, but I don’t see what to do :-/
Have you an idea ?


Edit :

problem solved, see below

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T06:24:35+00:00Added an answer on June 9, 2026 at 6:24 am

    The problem was the lib BoneCP who don’t use the property passed in parameters…
    I it by replacing :

    Properties props = new Properties();
    props.setProperty("characterEncoding", "UTF-8");
    props.setProperty("useUnicode", "true");
    
    BoneCPConfig config = new BoneCPConfig(props);
    config.setJdbcUrl("jdbc:mysql://" + MYSQL_HOST_NAME + "/" + MYSQL_BASE_NAME);
    

    with :

    BoneCPConfig config = new BoneCPConfig();
    config.setJdbcUrl("jdbc:mysql://" + MYSQL_HOST_NAME + "/" + MYSQL_BASE_NAME + "?user=" + MYSQL_LOGIN + "&password=" + MYSQL_PASSWORD + "&characterEncoding=utf-8");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have problem with JDBC application that uses MONEY data type. When I insert
I have a little problem to insert from 2 different table's in C# to
I have a problem reading a txt file to insert in the mysql db
I have some problem whith such mysql_query INSERT INTO table VALUES ('', CURDATE()-1) why
Gday All, I have a baffling problem whilst trying to insert some chinese characters
I have problem with my MySQL query: include '../inc/mysql_config.php'; $sql=INSERT INTO ordrar (id, order,
I am developing an application using oracle 11g, Java(struts2) and Hibernate. I have table
i have this problem i want to load an iframe, but when you insert
everybody; I have this problem in asp.net, I have a page where I insert
I have problem with mysql insert(). I have strings of variable length (15-20 chars)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.