无法创建 PoolableConnectionFactory(未知系统变量 'language')
Cannot create PoolableConnectionFactory (unknown system variable 'language')
有人遇到过这个错误吗?
Cannot create PoolableConnectionFactory (unknown system variable 'language')
使用 java、mysql、ibatis 编程。添加了一些代码,现有代码也会出现此错误。
以下是错误信息。
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)
下面是我的 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>
以下是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; }
您可能正在使用越野车 MySQL Connector/J?参见:
问题出在防火墙上。防火墙已阻止 java 访问其他计算机上的数据库。当允许访问时,我的程序开始工作。
我将 java 连接器库更改为 mysql-connector-java-5.1.23-bin.jar,效果很好。
这个问题是在 mysql-connector-java-5.1.36.jar
有人遇到过这个错误吗?
Cannot create PoolableConnectionFactory (unknown system variable 'language')
使用 java、mysql、ibatis 编程。添加了一些代码,现有代码也会出现此错误。
以下是错误信息。
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)
下面是我的 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>
以下是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; }
您可能正在使用越野车 MySQL Connector/J?参见:
问题出在防火墙上。防火墙已阻止 java 访问其他计算机上的数据库。当允许访问时,我的程序开始工作。
我将 java 连接器库更改为 mysql-connector-java-5.1.23-bin.jar,效果很好。 这个问题是在 mysql-connector-java-5.1.36.jar