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

  • SEARCH
  • Home
  • 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 8081763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:50:24+00:00 2026-06-05T16:50:24+00:00

I believe I am using the correct queryString params for jdbc connection jdbc:mysql://localhost:3306/databasename?useUnicode=true&characterEncoding=utf8&noAccessToProcedureBodies=true My

  • 0

I believe I am using the correct queryString params for jdbc connection

jdbc:mysql://localhost:3306/databasename?useUnicode=true&characterEncoding=utf8&noAccessToProcedureBodies=true

My database is correctly set-up to support utf-8 (default character variables).

character_set_client utf8
character_set_connection utf8
character_set_database latin1
character_set_filesystem binary
character_set_results utf8
character_set_server latin1
character_set_system utf8

My sproc defines each parameter as utf8 where necessary

IN _shortDesc MEDIUMTEXT character set utf8,

CALLing the sproc through MySQLWorkbench works as expected.
However, calling it from Java results in an exception

java.sql.SQLException: Incorrect string value: '\xAC\xED\x00\x05t\x00...' for column '_shortDesc'

Interestingly, changing sproc definition for relevant fields to utf16 or ucs2 results in no exception but incorrect Korean characters in the table.

I have also tried using a byte array when building the sql parameters in Java

getBytes(Charset.forName("UTF-8"))

But the exception is still thrown.

What is the correct way to set this up to correctly pass CJK characters through Java to MySQL via a stored procedure?

EDIT
I am using SimpleJdbcCall from the spring framework

DriverManagerDataSource ds = new DriverManagerDataSource();
ds.setDriverClassName("com.mysql.jdbc.Driver");
ds.setUrl("jdbc:mysql://server/test?characterEncoding=utf8");
ds.setUsername("user");  
ds.setPassword("pass");

// must explicitly declare params
SimpleJdbcCall jdbc = new SimpleJdbcCall(ds)
    .withProcedureName("sp_gms_addGameTranslationsTest");

SqlParameterSource in = new MapSqlParameterSource()
    .addValue("_test", "그러나 사디라");

jdbc.execute(in);
  • 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-05T16:50:25+00:00Added an answer on June 5, 2026 at 4:50 pm

    The root problem was I am using springframework SimpleJdbcCall to execute the stored procedure. That simplifies configuration by using databases metadata to figure things out for you. By explicitly declaring my input parameters when using that object, the call works fine.

    e.g.

    DriverManagerDataSource ds = new DriverManagerDataSource();
    ds.setDriverClassName("com.mysql.jdbc.Driver");
    ds.setUrl("jdbc:mysql://server/test?characterEncoding=utf8");
    ds.setUsername("user");  
    ds.setPassword("pass");
    
    // must explicitly declare params
    SimpleJdbcCall jdbc = new SimpleJdbcCall(ds)
        .withProcedureName("sp_gms_addGameTranslationsTest")
        .declareParameters(
            new SqlParameter("_test", Types.VARCHAR)
    );
    
    SqlParameterSource in = new MapSqlParameterSource()
        .addValue("_test", "그러나 사디라");
    
    jdbc.execute(in);
    

    I realise this answer was impossible to arrive at from my original question, so I have added an edit.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've read and I believe I understand what C#'s using statement does (please correct
I have two different-sized monitors, connected together using (I believe) TwinView. I tried System.out.println(Toolkit.getDefaultToolkit().getScreenSize());
I believe I am having a memory issue using numpy arrays. The following code
I believe I am having a security problem related to using the embed tag
I am using the jQuery-File-Upload widget (although I believe this question can generalize to
I designed a layout using what I believe are the best practices, dp, fill_parent,
I don't believe that I am using any 3.0 specific APIs, but somehow whenever
I can't believe, no one got my problem before. Using joomla 1.5 and VM
So I just trying to build a library using the NDK. I believe that
I'm not sure that I'm using the correct language here so I will give

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.