Home > Database > Mysql Tutorial > java-求教JAVA应用传入mysql中文乱码

java-求教JAVA应用传入mysql中文乱码

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 09:32:48
Original
1050 people have browsed it

mysqljava

JAVA的应用程序用JDBC连接mysql
类似汉字的查询都成功不了,插入汉字也是???乱码
从数据库返回的汉字正常。
数据库和MyEclipse都是GBK编码

?useUnicode=true&characterEncoding=UTF-8
这个试过了 没用
查询代码如下
java.sql.Statement stmt = connection.createStatement();
String string="哦";

ResultSet rs = stmt.executeQuery("select * from fix where q='"+string+"'");

while (rs.next()) {

System.out.println(rs.getString(3) + "\t" + rs.getString(4));

}
求解怎么传入汉字

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template