Friday, 15 June 2012

java - How should I use UTF-8 in MySQL? -


I set my Marieby to the default character set UTF-8. According to the setting which will save me from the problem of unreliable accented 'ÃÆ'à s â € ™ Ã⠀ šÃ, ©

However, I

  titled titled titled SELECT = 'some time ago'   

where some time ago is not necessary, the emphasis is on the letter.

Is UTF a unique way to handle 8 character sets? Because it seems that it does not recognize strings in Java.

In Java code

  string query = "title select where title ="; Created location pstate = conn.getPreparedStatement (query); As a result result; String tectilist = null; PState.setString (1, "Mon  xt"); Results = pState.executeQuery (); If (result.next ()) textResult = result.getString (1); Println (textResult);   

Output:

  blank   

another approach

1)

  string query = "selection of tablename title where convert (use UTF 8) ="? ";   

2)

  string query =" select title where title =? "; Byte [] rake =" mon   

Output

  null  < / Pre> 

four set = utf8

Before the character set = utf8, my first setup of the database is the default character set, With latin1_swedish_ci.My field 'Tablelename' with Datatype = VARBINARY (), with unfamiliar pronunciation solution

  SELECT * FROM tablename WHERE CONVERT (UTF8 use title) = 'somet'   

However, because in my database 10 million Using the CONVERT function on the entire 'Title' field, SQL queries and Java programs run very slowly.

Your choice of character set determines how your text information is stored but it is a match of your choice Which determines where your stories match that information.

Try

  Tablename select title where title =? If this works - If you want to start getting the lines - Change the title column in your table as follows  
  Alternate table Tablename1 CHANGE Title Title VARCHAR (xxxx) Character set utf8 COLLATE utf8_general_ci NULL   

You should actually use the current definition of the title column and just click the COLLATE utf8_general_ci section. Once you make this change, you may need to re-index your index, but at any rate your match will start working correctly.

If you have a special language If you are working with, then you would like to adopt your own match, for example, in normal collation N and A ?? Is considered as the same letter, but in Spanish they are not.

No comments:

Post a Comment