Skip navigation links

MySQL Forums :: Connector/JDBC and Java :: Unable to retrieve unicode data


Advanced Search

Re: Unable to retrieve unicode data
Posted by: Leonard Fernandes ()
Date: April 26, 2012 12:00AM

I have isolated this as probably being a JDBC issue.

After I removed
keyword = new String(keyword.getBytes("ISO-8859-1"), "UTF-8");
and used the keyword directly, I got some results. But it is not consistent and I sometimes get and sometimes don't

Can you help me?

The code is below:


/*try {keyword = new String(keyword.getBytes("ISO-8859-1"), "UTF-8");
} catch (UnsupportedEncodingException usee){keyword = "";}*/

keyword = Utilities.replaceQuotes(keyword);


String sequel = "SELECT book_name, book_isbn FROM book_resource_view WHERE MATCH(book_name, book_isbn, bookauthor) AGAINST ('"+keyword+"') ";

Connection objConn = null;
Statement state = null;
ResultSet results = null;
ConnectionPool connectionPool = null;

try {
connectionPool = new ConnectionPool(10, 50, true);
state = objConn.createStatement();

String query = "set names utf8";
state.executeUpdate(query);

//query = "set character set utf8";
//state.executeUpdate(query);

results = state.executeQuery(sequel);

Options: ReplyQuote


Subject Written By Posted
Unable to retrieve unicode data Leonard Fernandes 03/28/2012 06:59AM
Re: Unable to retrieve unicode data Peter Brawley 03/28/2012 02:04PM
Re: Unable to retrieve unicode data Leonard Fernandes 03/28/2012 09:55PM
Re: Unable to retrieve unicode data Rick James 03/29/2012 10:14PM
Re: Unable to retrieve unicode data Leonard Fernandes 04/01/2012 12:52AM
Re: Unable to retrieve unicode data Leonard Fernandes 04/25/2012 11:59PM
Re: Unable to retrieve unicode data Leonard Fernandes 04/26/2012 12:00AM
Re: Unable to retrieve unicode data Mark Matthews 04/26/2012 01:37PM
Re: Unable to retrieve unicode data Rick James 04/26/2012 08:39PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.