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 9256231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:53:33+00:00 2026-06-18T11:53:33+00:00

I have a database with MEDIUMBLOB fields in tables with ENGINE=InnoDB DEFAULT CHARSET=utf8 on

  • 0

I have a database with MEDIUMBLOB fields in tables with ENGINE=InnoDB DEFAULT CHARSET=utf8 on each table.

I connect to the database with useUnicode=true&characterEncoding=UTF8&character_set_client=UTF8&character_set_database=UTF8&character_set_results=UTF8&character_set_server=UTF8&character_set_system=UTF8 on the URL.

(I have tried with just useUnicode=true&characterEncoding=UTF8 with the same results.)

When I look at values in the database using mysql from the command-line, I can see non-ASCII characters just fine.

But when I read in strings from the database using executeQuery() getString() I get gibberish. How can I read in the values correctly?

I am using log4j to show the strings I am writing to the database, and those I read back, and those I write show fine.

  • 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-18T11:53:34+00:00Added an answer on June 18, 2026 at 11:53 am

    That’s a BLOB, not a string. So you want getBytes and decode it manually.

     new String( bytes, "UTF-8"); //Subsitute "UTF-8" with whatever encoding the blob is in
    

    If you want more transparent support, defined a mediumtext column with UTF-8. Then all that configuration will become effective and you get proper strings automatically with getString.

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

Sidebar

Related Questions

i have database table with few text fields which i use to filter data
I have database MySQL and in one of the tables fields I have a
I have database tables like this: TABLE: User UserId UserName TABLE: UserToOrganization UserId OrganizationId
I have database table with following fields FieldId FieldGroupId FieldName I need to select
I have database with many tables. In the first table, I have a field
I have database dbadmin , table - tbl_empreimburse with fields-emp_id,rem_amount,rem_date . I want to
I have database with multiple tables in Microsoft SQL Server with schema in tables
i have database table like this +-------+--------------+----------+ | id | ip | date |
I have database, and in one the tables I need change the values of
that my problem: I have database table like that: id (AI) market_id 1 6

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.