从Java调用存储过程我得到了吗?用于包含希腊字符的字符串

时间:2018-10-15 12:52:19

标签: java mysql stored-procedures

我在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);
}

0 个答案:

没有答案