无法创建PoolableConnectionFactory(未知系统变量'language')

时间:2022-09-24 23:29:08

Anyone who had troubled with this error?

有谁犯过这个错误吗?

Cannot create PoolableConnectionFactory (unknown system variable 'language')

Programming with java, mysql, ibatis. Added some codes and existing codes make this error as well.

用java, mysql, ibatis编程。添加一些代码和现有代码也会导致此错误。

Below are the error messages.

下面是错误消息。

org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Unknown system variable 'language')

at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.init(JdbcTransaction.java:48)
at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.getConnection(JdbcTransaction.java:89)
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForObject(GeneralStatement.java:104)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:566)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:541)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:106)
at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClientImpl.java:83)
at kes.db.dao.BaseDao.getObject(BaseDao.java:116)
at ocserver.android.service.dao.TB_OC_USER_BADGE_INFO_DAO.confirmNotification(TB_OC_USER_BADGE_INFO_DAO.java:21)
at ocserver.android.service.action.PushNotificationBadgeModAction.requestTEXT(PushNotificationBadgeModAction.java:66)
at kes.controller.TEXTServletAction.requestTEXT(TEXTServletAction.java:82)
at kes.controller.TEXTServletAction.doPost(TEXTServletAction.java:58)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)

And below are my sql statement.

下面是我的sql语句。

    <select id="select_TB_OC_USER_BADGE_INFO_001" parameterClass="TB_OC_USER_BADGE_INFO_VO" resultClass="TB_OC_USER_BADGE_INFO_VO">
        <![CDATA[
            SELECT
                    BADGE_MC,
                    BADGE_WB
                FROM
                    TB_OC_USER_BADGE_INFO
                WHERE
                    USER_ID = #USER_ID#
                AND
                    COMPANY_CODE = #COMPANY_CODE#
        ]]>
    </select>

Belows are TB_OC_USER_BADGE_INFO_VO. Didn't bring getter and setter.

下部TB_OC_USER_BADGE_INFO_VO。没有带来getter和setter。

public class TB_OC_USER_BADGE_INFO_VO {

    private String USER_ID;
    private String COMPANY_CODE;
    private String TYPE;
    private int BADGE_MC;
    private int BADGE_WB; }

3 个解决方案

#1


1  

The problem was firewall. The firewall had blocked java to access to database on other computer. When permitted the access, my program started working.

是防火墙的问题。防火墙阻止了java访问其他计算机上的数据库。当允许访问时,我的程序开始工作。

#2


1  

I change my java connector library to mysql-connector-java-5.1.23-bin.jar and it works good. This problem was in mysql-connector-java-5.1.36.jar

我将java连接器库更改为mysql-connector-java-5.1.23-bin。jar,效果很好。这个问题出现在mysql-connector-java-5.1.36.jar中

#3


0  

Are you maybe using the buggy MySQL Connector/J? See:

你可能用的是有问题的MySQL连接器/J吗?看到的:

#1


1  

The problem was firewall. The firewall had blocked java to access to database on other computer. When permitted the access, my program started working.

是防火墙的问题。防火墙阻止了java访问其他计算机上的数据库。当允许访问时,我的程序开始工作。

#2


1  

I change my java connector library to mysql-connector-java-5.1.23-bin.jar and it works good. This problem was in mysql-connector-java-5.1.36.jar

我将java连接器库更改为mysql-connector-java-5.1.23-bin。jar,效果很好。这个问题出现在mysql-connector-java-5.1.36.jar中

#3


0  

Are you maybe using the buggy MySQL Connector/J? See:

你可能用的是有问题的MySQL连接器/J吗?看到的: