前言
说说这个问题吧,网上关于这个错的基本都是说编码问题,但是我这个不同
2020-11-23 19:19:59.233 ERROR 13936 --- [eate-1242969461] com.alibaba.druid.pool.DruidDataSource : create connection SQLException, url: jdbc:informix-sqli://56.1.88.240:9137/gd4400car3gdb:informixServer=gd_4400_cb_bcv1;NEWCODESET=gbk,8859-1,819, errorCode -79784, state IX000
java.sql.SQLException: Locale not supported.
at com.informix.util.IfxErrMsg.buildException(IfxErrMsg.java:420) ~[informix-jdbc-4.50.1.jar:4.50.1]
at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:387) ~[informix-jdbc-4.50.1.jar:4.50.1]
at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:379) ~[informix-jdbc-4.50.1.jar:4.50.1]
at com.informix.jdbc.IfxSqliConnect.parseIfxLocale(IfxSqliConnect.java:3298) ~[informix-jdbc-4.50.1.jar:4.50.1]
at com.informix.jdbc.IfxSqliConnect.setDatabaseLocale(IfxSqliConnect.java:3059) ~[informix-jdbc-4.50.1.jar:4.50.1]
at com.informix.jdbc.IfxSqliConnect.setDatabaseOpen(IfxSqliConnect.java:2901) ~[informix-jdbc-4.50.1.jar:4.50.1]
at com.informix.jdbc.IfxSqli.callsetDatabaseOpen(IfxSqli.java:2575) ~[informix-jdbc-4.50.1.jar:4.50.1]
at com.informix.jdbc.IfxSqli.executeOpenDatabase(IfxSqli.java:1834) ~[informix-jdbc-4.50.1.jar:4.50.1]
at com.informix.jdbc.IfxSqliConnect.<init>(IfxSqliConnect.java:1732) ~[informix-jdbc-4.50.1.jar:4.50.1]
at com.informix.jdbc.IfxDriver.connect(IfxDriver.java:198) ~[informix-jdbc-4.50.1.jar:4.50.1]
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1644) ~[druid-1.1.22.jar:1.1.22]
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1710) ~[druid-1.1.22.jar:1.1.22]
at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2779) ~[druid-1.1.22.jar:1.1.22]
原因
驱动包太高,数据库又不确定版本,或者说新老不匹配
datasource: #database
url: jdbc:informix-sqli://1234/data:informixServer=haha;NEWCODESET=gbk,8859-1,819
username: name
password: mima
driver-class-name: com.informix.jdbc.IfxDriver
这个版本太高了,informix的驱动包比较老,降低版本即可
<dependency>
<groupId>com.ibm.informix</groupId>
<artifactId>jdbc</artifactId>
<version>4.50.4.1</version>
</dependency>
解决
<dependency>
<groupId>com.ibm.informix</groupId>
<artifactId>jdbc</artifactId>
<version>4.10.9</version>
</dependency>