Java Oracle 10G XE 的 JDBC 驱动程序

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2053584/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 03:02:41  来源:igfitidea点击:

JDBC driver for Oracle 10G XE

javaoraclejdbc

提问by Sam

I have installed Oracle 10G XE. I want to connect to it using JDBC . Which driver should i use for it and from where can i download it ?

我已经安装了 Oracle 10G XE。我想使用 JDBC 连接到它。我应该使用哪个驱动程序以及从哪里下载它?

Thank You.

谢谢你。

采纳答案by Pascal Thivent

On the machine you have installed the server, Oracle JDBC drivers are in ORACLE_HOME/jdbc/lib. Just put ojdbc14.jaron your classpath (ojdbc14_g.jaris the same as ojdbc14.jar, except that classes were compiled with "javac -g" and contain some tracing information).

在您安装服务器的机器上,Oracle JDBC 驱动程序位于ORACLE_HOME/jdbc/lib. 只需放入ojdbc14.jar您的类路径(ojdbc14_g.jar与 相同ojdbc14.jar,只是类是用“javac -g”编译的并包含一些跟踪信息)。

EDIT:According to Oracle Database 10g Release 2 (10.2.0.4) JDBC Drivers, ojdbc14.jarcontains classes for use with JDK 1.4 and 1.5(and I don't see why it wouldn'twork with a JDK 6, some features of JDBC 4.0 won't just be available).

编辑:根据Oracle Database 10g Release 2 (10.2.0.4) JDBC Driversojdbc14.jar包含与 JDK 1.4 和 1.5 一起使用的类(我不明白为什么它不能与 JDK 6 一起使用,JDBC 4.0 的某些特性赢得了不只是可用)。

Some newer drivers are available at Oracle Database 11g Release 2 JDBC Driversbut I don't really see the difference between ojdbc14.jarand ojdbc15.jar(except that ojdbc15.jarrequires a JDK 5+): they are both JDBC 3.0 driverso I think it's just a matter of end of life support for ojbdc14.jar. If you want JDBC 4.0 support, you'll need ojdbc16.jarthough. Have a look at the Oracle JDBC FAQif you want more details.

一些较新的驱动程序可从Oracle数据库11g第2版JDBC驱动,但我实在不明白之间的差别ojdbc14.jar,并ojdbc15.jar(除了ojdbc15.jar需要JDK 5+):他们都是JDBC 3.0驱动程序,所以我认为它只是一个结束的事的生命支持ojbdc14.jar。如果您想要 JDBC 4.0 支持,您将需要ojdbc16.jar。如果需要更多详细信息,请查看Oracle JDBC FAQ

回答by Mark Wilkins

According to this getting started guideyou need the Oracle Express client which can be found here

根据此入门指南,您需要可在此处找到的 Oracle Express 客户端

回答by Thilo

http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html

http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html

You generally want the latest JDBC drivers, they will work with older versions of the database as well. Or, to be on the safe side, match the JDBC version with your DB.

您通常需要最新的 JDBC 驱动程序,它们也适用于旧版本的数据库。或者,为了安全起见,将 JDBC 版本与您的数据库相匹配。

回答by duffymo

You want to choose a JDBC driver that matches both your version of Oracle and the JDK you're using. ojdbc14.jar is for JDK 1.4; there are newer versions for at least JDK 5 that I know of. I'm not sure if there's a JDBC driver for JDK 6. Use the best match to your situation that Oracle makes available.

您希望选择与您的 Oracle 版本和您使用的 JDK 相匹配的 JDBC 驱动程序。ojdbc14.jar 适用于 JDK 1.4;我知道至少有 JDK 5 的更新版本。我不确定是否有适用于 JDK 6 的 JDBC 驱动程序。使用 Oracle 提供的最适合您的情况的驱动程序。