JAVA applications cannot connect to mysql for queries similar to Chinese characters through JDBC ??? Garbled Chinese characters returned from the database are normal. Is the database and MyEclipse both GBK encoding? UseUnicodetrue & amp; characterEncodingUTF-8 this tried useless query code below java. SQL. Statementstmtconnection. createStatement (); Stringstring & quot; Oh & quot; ResultSetrsstmt mysqljava
JAVA applications use JDBC to connect to mysql
Query similar to Chinese characters fails ??? Garbled
The Chinese characters returned from the database are normal.
Both database and MyEclipse are GBK encoded
? UseUnicode = true & characterEncoding = UTF-8
This is useless.
The query code is as follows:
Java. SQL. Statement stmt = connection. createStatement ();
String string = "oh ";
ResultSet rs = stmt.exe cuteQuery ("select * from fix where q = '" + string + "'");
While (rs. next ()){
System. out. println (rs. getString (3) + "\ t" + rs. getString (4 ));
}
How to input Chinese characters