LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
LinkBack Search this Thread
Old 07-16-2009, 02:12 AM   #1
nikhil010586
Member
 
Registered: Oct 2007
Posts: 44

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


Hi,

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:
Code:
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:

Code:
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, 08:46 AM   #2
nikhil010586
Member
 
Registered: Oct 2007
Posts: 44

Original Poster
Rep: Reputation: 15
No replies yet?
 
  


Reply

Tags
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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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


All times are GMT -5. The time now is 02:39 AM.

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