Skip to content

Commit 167d1d5

Browse files
committed
Server:解决不能搜索中文
1 parent 6051796 commit 167d1d5

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • APIJSON-Java-Server/APIJSON-Eclipse/src/main/java/zuo/biao/apijson/server/sql

APIJSON-Java-Server/APIJSON-Eclipse/src/main/java/zuo/biao/apijson/server/sql/SQLExecutor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ public class SQLExecutor {
6565
*/
6666
private synchronized Connection getConnection() throws Exception {
6767
Log.i(TAG, "成功加载MySQL驱动!");
68-
return DriverManager.getConnection(SQLConfig.MYSQL_URI, SQLConfig.MYSQL_ACCOUNT, SQLConfig.MYSQL_PASSWORD);
68+
return DriverManager.getConnection(SQLConfig.MYSQL_URI + "?useUnicode=true&characterEncoding=UTF-8&user="
69+
+ SQLConfig.MYSQL_ACCOUNT + "&password=" + SQLConfig.MYSQL_PASSWORD);
6970
}
7071

7172
/**保存缓存

0 commit comments

Comments
 (0)