gpt4 book ai didi

java - 带有 Hibernate 4.2 错误 : setCharacterStream(ILjava/io/Reader;J)V is abstract 的 C3p0

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:55:03 25 4
gpt4 key购买 nike

我正在将 Hibernate 4.2 与 c3p0 一起使用,但出现此错误:Method com/mchange/v2/c3p0/impl/NewProxyPreparedStatement.setCharacterStream(ILjava/io/Reader;J)V is abstract

有人知道我应该使用哪个版本吗?这是我当前的 Maven 依赖项列表:

<dependency>
<groupId>com.mchange</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.2</version>
</dependency>

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-c3p0</artifactId>
<version>4.2.0.Final</version>
</dependency>

最佳答案

PreparedStatement.setCharacterStream()方法已添加到 JDBC 4 并根据 C3P0 release notes :

As of version 0.9.5, c3p0 fully supports the jdbc4 spec.

所以你需要update the C3p0 library to 0.9.5 :

<dependency>
<groupId>com.mchange</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.5</version>
</dependency>

您还可以从 Hibernate 中排除 C3P0 依赖项,以确保 Maven 使用您显式配置的依赖项:

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-c3p0</artifactId>
<version>4.2.0.Final</version>
<exclusions>
<exclusion>
<artifactId>c3p0</artifactId>
<groupId>c3p0</groupId>
</exclusion>
</exclusions>
</dependency>

关于java - 带有 Hibernate 4.2 错误 : setCharacterStream(ILjava/io/Reader;J)V is abstract 的 C3p0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28399545/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com