Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Inserting ? into MySQL Problem

 
Ted Smyth
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good Afternoon All,

I'm having problems inserting '?' characters into a MySQL database from JDBC ONLY - PHPMyAdmin interface has no problems. The strings containing questions marks are being parsed from an MS Excel (2003) file via POI's HSSF API.

It looks like a character encoding issue, so maybe this should be moved to a different forum, but I'll start here and see what kind of input I can get.

My exception is this:



Yeah, I use Commons DBUtils .

If anyone had any thoughts or experience with a similar issue, I'd love to hear about it.

Thanks!
[ August 04, 2008: Message edited by: Scott Selikoff ]
 
Ted Smyth
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well I solved the problem after getting my head out of Java and into MySQL.

My tables had some weird character encoding set. Changed to UTF-8 and fixed.

Thanks to any who had a look at this thread!
 
Scott Selikoff
author
Saloon Keeper
Posts: 4033
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've seen issues with this where the character '?' was in the string of a PreparedStatement and it caused errors. If I recall the solution was to change the character '?' to an actual ? and then use the setString() method such as:


versus:

[ August 04, 2008: Message edited by: Scott Selikoff ]
 
Ted Smyth
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the input Scott, I've managed to dodge that issue so far, let's hope I continue to .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic