symbol being replaced by ? during data transfer

Hi
I have an MySQL 5.1 database which is set up to use Unicode (utf8) charactersets and collections.

I have uploaded an approximately equal symbol  (Shmax ≈ Shmin) and when I view it in my first table it looks fine.

We then use an insert command  ( Java and uses Hibernate API for persistence) to transfer the data to a second table which has also been set up with utf8 collections but when I view this table after the data transfer the data has now become Shmax ? Shmin

Can anyone tell me what is causing this behaviour and how I can get around it.
NemetonaAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CEHJCommented:
but when I view this table after the data transfer
Are you viewing it with the same application as the one you're viewing the source table with and is it set up in the same way?
0
jimyXCommented:
You have set your Database to handle Unicode, you need to do the same for your Java application.
I am not a Java expert but can suggest, try UTF8 Encode/Decode.
0
NemetonaAuthor Commented:
When I view the contents of the table  in MySQL workbench, the original table displays Shmax ≈ Shmin but the second table, after the data has been inserted, displays Shmax ? Shmin.  If I manually update the second table then it will hold the value of Shmax ≈ Shmin.

I have also check the original table on a web page (.jsp) and it does show Shmax ≈ Shmin.

The second table displays Shmax ? Shmin

As far as I can tell the problem arises with the data insert command.
0
Protecting & Securing Your Critical Data

Considering 93 percent of companies file for bankruptcy within 12 months of a disaster that blocked access to their data for 10 days or more, planning for the worst is just smart business. Learn how Acronis Backup integrates security at every stage

CEHJCommented:
Can you please execute the following (change placeholder as appropriate) at the MySql client prompt and post the last meaningful line?
show create table target_table;

Open in new window

0
NemetonaAuthor Commented:
This is the create table statement for the two tables I am using:

CREATE TABLE `Table1` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `ANSWER_REF` varchar(11) DEFAULT NULL,
  `QUESTION_ID` int(11) NOT NULL,
  `ANSWER_TEXT` mediumtext NOT NULL,
  `IS_CORRECT` int(11) NOT NULL,
  `POINTS` int(10) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=1822 DEFAULT CHARSET=utf8

CREATE TABLE `Table2` (
  `ID` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Unique ID of the Assessment Answer',
  `ANSWER_REF` varchar(10) DEFAULT NULL COMMENT 'Maps to the ID of the original Answer it was derived from',
  `ASSESSMENT_QUESTION_ID` int(11) NOT NULL COMMENT 'Maps to the Assessment Question Id the answer belongs to',
  `ANSWER_TEXT` mediumtext CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL COMMENT 'A snapshot of the exact answer text with unicode',
  `IS_CORRECT` int(11) NOT NULL COMMENT 'True if this assessment answer is correct',
  `POINTS` int(11) NOT NULL COMMENT 'The points awareded if this assessment answer is selected',
  `IS_SELECTED` int(1) DEFAULT NULL COMMENT 'Set to true if the delegate has selected this answer in the assessment',
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=9187 DEFAULT CHARSET=utf8
0
CEHJCommented:
OK. Try the following form for the driver connection string

jdbc:mysql://hostname/dbname?useUnicode=true&characterEncoding=UTF8;
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CEHJCommented:
:)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.