java.sql.sqlexception:将hikaricp与配置单元jdbc一起使用时不支持方法

x4shl7ld  于 2021-06-28  发布在  Hive
关注(0)|答案(1)|浏览(376)

我使用mysql作为hive的元存储。
在我的jdbc代码中

DriverManager.getConnection(connectionUri, username, password);

HikariDataSource ds = new HikariDataSource();
 ds.setJdbcUrl(connectionUri);
 ds.setUsername(username);
 ds.setPassword(password); 
 return ds.getConnection();

我有以下例外:

com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Method not supported
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:514)
at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:107)
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:94)
at com.impetus.idw.data.connector.utils.JDBCUtil.getJdbcConnection(JDBCUtil.java:173)
at com.impetus.idw.data.connector.utils.JDBCUtil.checkTableExistence(JDBCUtil.java:66)
at com.impetus.idw.data.connector.datasource.HiveTable.exists(HiveTable.java:146)
at com.impetus.idw.data.connector.tools.hive.HiveToHiveCopyBaseTest.testMetadata(HiveToHiveCopyBaseTest.java:25)
at com.impetus.idw.data.connector.tools.hive.LocalToLocalTest.testHive(LocalToLocalTest.java:19)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: java.sql.SQLException: Method not supported
at org.apache.hive.jdbc.HiveConnection.setReadOnly(HiveConnection.java:1271)
at com.zaxxer.hikari.pool.PoolBase.setupConnection(PoolBase.java:372)
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:346)
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:508)
... 31 more

hikaricp支持hive jdbc吗?
有没有办法避免打电话给你 org.apache.hive.jdbc.HiveConnection.setReadOnly 方法?

hfsqlsce

hfsqlsce1#

使用最新的(>2.0.0)配置单元驱动程序。请参阅在配置单元中解决的问题。

相关问题