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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:33:30+00:00 2026-05-24T19:33:30+00:00

I have three textfields (ID,Name,Address) which reflects columns in DB table i’m trying to

  • 0

I have three textfields (ID,Name,Address) which reflects columns in DB table i’m trying to insert arabic characters into that table but it appears as “?????”

iam connecting to DB using JDBC
my Database info. : MySQL Server 5.5.14 community
Server characterset: latin1
Db characterset: utf8
Client characterset: latin1
Conn. characterset: latin1

i try to encode strings using the following code:

private String ArEncode(String text){
    String txt="";

    try {

        Charset cset = Charset.forName("utf8");
        CharsetEncoder encoder = cset.newEncoder();
        CharsetDecoder decoder = cset.newDecoder();
        ByteBuffer buffer = encoder.encode(CharBuffer.wrap(text));
        txt=buffer.asCharBuffer().toString();        

    } catch (Exception ex) {
        Logger.getLogger(UserView.class.getName()).log(Level.SEVERE, null, ex);
    }
    return txt;
}

then the returned string “txt” is inserted in to the database

note: when i try to insert values directly into DB from netbeans it is inserted correctly and the Arabic characters appears correctly.

  • 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-24T19:33:31+00:00Added an answer on May 24, 2026 at 7:33 pm

    Why would you do this? It’s the job of the mysql JDBC driver to encode strings correctly in the declared database character set. Set your character set in the database to UTF-8, set the JDBC options correctly, and just do a plain insert of a plain old String.

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

Sidebar

Related Questions

I have a form(table view) which contains textfields and textview as subviews,I need to
I have a form in my iPhone application which contains three textFields and a
I have three tables in the many-to-many format. I.e, table A, B, and AB
So you have UINavigationController, with a parent table which has one cell --------------- |
Im trying to implement pagination using multiple searching criteria. Supposed I Have student table.
I do have Three TextField For Name Phone and Email. On selecting each textField
Hi I'm trying to add my image name to my database, I have a
I have three tables: page, attachment, page-attachment I have data like this: page ID
I have three tables tag , page , pagetag With the data below page
I have three models: class ReleaseItem < ActiveRecord::Base has_many :pack_release_items has_one :pack, :through =>

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.