Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 07-16-2009, 03:12 AM   #1
Registered: Oct 2007
Posts: 44

Rep: Reputation: 15
java.sql.SQLException: Incorrect string value


Recently, I faced this issue with Java-MySQL connection. Upon looking at the stack-trace I could find the cause of this exception as follows:
java.sql.SQLException: Incorrect string value: '\xC2\x80\xC2\x99s+...' for column 'target' at row 1
'target' happens to be one of the columns of of a table in my schema and contains some http links in the form of strings. Surprisingly, the same code is running on three different machines but however, this Exception was observed only on one machine. Upon searching through forums, I could find that this issue has got something to do with the character encoding. So I just checked the LANG environment variable of the machines and found them all to be LANG= en_US.UTF-8 .

Further, I checked the MySQL connection variables and got the following results on all three machines:

mysql> SHOW VARIABLES LIKE '%_connection';
 Variable_name             Value
 character_set_connection  latin1
 collation_connection      latin1_swedish_ci
Is there something that I'm missing out on that single machine?
Old 07-21-2009, 09:46 AM   #2
Registered: Oct 2007
Posts: 44

Original Poster
Rep: Reputation: 15
No replies yet?


encoding, iso, java, mysql, utf8

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
embedding sql in java pranith Programming 3 04-09-2010 10:08 AM
Java double addition gives incorrect answers qwerty Programming 6 02-19-2006 04:41 PM
java.lang.InstantiationException: java.sql.Connection poeta_boy Programming 2 07-06-2005 09:26 PM
compare string in SQL hus Programming 9 04-27-2005 11:17 AM
java test if string in string array is null. exodist Programming 3 02-21-2004 02:39 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:03 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration