从源代码构建 MySql JDBC 驱动程序时出错

发布于 2024-12-21 23:42:13 字数 553 浏览 2 评论 0原文

当我尝试从 此处 下载的源代码构建 JDBC 驱动程序时,我得到许多编译错误。例如,

继承的抽象方法 CallableStatement.getCharacterStream(int)

CallableStatement 类型必须实现CallableStatement.java line 57 中

所有这些错误都表明,我认为该驱动程序与 JDK 1.5 兼容,因为指定的方法不是 JDK 1.5 中 JDBC 规范的一部分。

但是,当我尝试使用 JDK 1.5 构建驱动程序时,出现错误,指示需要 JDK 1.6。例如,

无法解析 import java.sql.RowIdLifetime

,其中 RowIdLifetime 是不属于 JDK 1.5 的类。

那么,是哪一个呢? JDK 1.5 还是 1.6?当我尝试构建时我是否遗漏了一些东西?

When I try to build the JDBC driver, from the source downloaded from here , I get many compilation errors. For example,

The type CallableStatement must implement the inherited abstract method CallableStatement.getCharacterStream(int)

in CallableStatement.java line 57

All these error indicate, I thought, that the driver is compatible with JDK 1.5, because the specified method wasn't part of the JDBC spec in JDK 1.5.

However, when I tried to build the driver with JDK 1.5, I got errors indicating that JDK 1.6 is required. For example,

The import java.sql.RowIdLifetime cannot be resolved

where RowIdLifetime is a class that wasn't part of JDK 1.5.

So, which one is it? JDK 1.5 or 1.6? Am I missing something when I try to build?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

始终不够 2024-12-28 23:42:13

阅读了与源代码捆绑在一起的文件 connector-j.html 后,看起来我需要两者:

如果您正在构建 Connector/J 5.1,请确保您已安装 JDK 1.6.x 和较旧的 JDK,例如 JDK 1.5.x。这是因为 Connector/J 同时支持 JDBC 3.0(早于 JDK 1.6.x)和 JDBC 4.0。将 JAVA_HOME 环境变量设置为旧版 JDK 安装的路径。

下次,我会在发帖前进行 RTM。

Having read the file connector-j.html that is bundled with the source, it looks like I need both:

If you are building Connector/J 5.1 make sure that you have both JDK 1.6.x installed and an older JDK such as JDK 1.5.x. This is because Connector/J supports both JDBC 3.0 (which was prior to JDK 1.6.x) and JDBC 4.0. Set your JAVA_HOME environment variable to the path of the older JDK installation.

Next time, I'll RTM before posting.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文