我在mysql
中有一个表,其中包含一个名为strength_unit_code的字段,其值为μg
。
我有一个stored procedure
来检索该值。从mysql workbench
中我可以正确地得到值。
当我尝试从Java调用stored-procedure
检索数据时,我得到了?g
。
表排序规则为utf8 - default collation
。
我正在使用rs.getString("strength_unit_code")
来获取价值。
我正在使用mysql版本5.7.14,java版本1.8.0_171和JDBC驱动程序5.1.40。
这是我的jdbc连接URI:
this.db_connect_string = "jdbc:mysql://localhost/test";
this.userName = "test";
this.password = "*****";
}
protected Connection getDBMySQLCon() {
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
return DriverManager.getConnection(this.db_connect_string+"?useSSL=false", this.userName, this.password);
}