KSQLException: The authentication type 10 is not supported.

家树發表於2024-06-19

Java應用使用人大金倉資料庫啟動時報錯:

Caused by: com.kingbase8.util.KSQLException: The authentication type 10 is not supported. Check that you have configured the sys_hba.conf file to include the client's IP 
address or subnet, and that it is using an authentication scheme supported by the driver.
        at com.kingbase8.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:627)
        at com.kingbase8.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:231)
        at com.kingbase8.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
        at com.kingbase8.jdbc.KbConnection.<init>(KbConnection.java:202)
        at com.kingbase8.Driver.makeConnection(Driver.java:486)
        at com.kingbase8.Driver.connect(Driver.java:283)
        at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138)
        at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:353)
        at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:201)
        at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:473)
        at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:562)

報錯提示不支援的認證型別。原因是使用了舊版的JDBC驅動包去連線新版本資料庫,舊版驅動中缺少了某種認證型別。

解決方案:升級JDBC驅動

比如我這裡是把kingbase-driver-8.2.0.jar替換為kingbase8-8.6.0.jar

相關文章