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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:38:14+00:00 2026-05-16T05:38:14+00:00

I wrote a JSP code that needs to run some mysql INSERT queries that

  • 0

I wrote a JSP code that needs to run some mysql INSERT queries that contains non-English chars (Persian). I run two types of queries first one is static application installation queries and second one is user inputs. After execution of both of queries non-English chars are imported as “?” as I check them in application itself and phpMyAdmin!

I tried to execute these queries after connection but I didn’t help:

SET NAMES utf8
SET CHARACTER SET utf8
SET SESSION collation_connection = 'utf8_general_ci'

What’s the problem ? How can I fix it?

  • 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-05-16T05:38:15+00:00Added an answer on May 16, 2026 at 5:38 am

    After execution of both of queries none english chars are imported as “?” as I check them in application itself and phpMyAdmin!

    So, the database (or more specifically, the JDBC driver) is not using UTF-8 during INSERT.

    Usually the database’s JDBC driver should be smart enough to use the database and/or table specified encoding for storing the data. But in some cases you have to specify the character encoding in the connection string as well. This is true in case of MySQL JDBC driver because it does not use the database-specified encoding, but the client-specified encoding. How to configure it should already be answered in the JDBC driver documentation. In for example MySQL you can read it here:

    jdbc:mysql://localhost:3306/db_name?useUnicode=yes&characterEncoding=UTF-8

    That said and unrelated to the problem, you should in fact try to avoid raw Java code in a JSP file. It would only lead to another kinds of problems in the future.

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

Sidebar

Ask A Question

Stats

  • Questions 513k
  • Answers 513k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If you compile an app using the 4.x SDK but… May 16, 2026 at 5:51 pm
  • Editorial Team
    Editorial Team added an answer It's not because it doesn't make sense; it makes perfect… May 16, 2026 at 5:51 pm
  • Editorial Team
    Editorial Team added an answer You can make all instantiation of the Account model go… May 16, 2026 at 5:51 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I've a JSP/Servlet Web App that consist of more than one servlet (and some
I am learning JSP and Java at the moment and wrote a (very) simple
I have a web app consisting of some JSPs that were previously running on
I've always found that defining URLs for other pages in a Web Application seems
When I write Java webapps, I usually use JSTL tags. I think that these
I'm writing a jsp application, what i did so far was to include the
I have the following sample code where I download a pdf from the European
A user has a few Lookup selections on a JSP page. After he's selected
I'm looking for a sed command that, with find , I can take a
This is the situation: We have some binary files (PDFs, PPTs, ZIPz, etc.) stored

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.