oracle 什么是 ojdbc6.jar 文件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/31363047/
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-09-19 02:56:59  来源:igfitidea点击:

What is ojdbc6.jar file?

javaoraclejdbcjarojdbc

提问by matip

For school project I had to make program in Java that uses data base and to do so I had to import to that project file ojdbc6.jar. I know that without it I couldn't use data bases but I don't really know what is this file. Could someone explain? How such file is called and what exactly is its purpose?

对于学校项目,我必须用 Java 编写使用数据库的程序,为此我必须导入该项目文件 ojdbc6.jar。我知道没有它我就不能使用数据库,但我真的不知道这个文件是什么。有人能解释一下吗?如何调用这样的文件,它的目的究竟是什么?

回答by Stephen C

Simply stated, a JDBC driver is a suite of classes that map the functionality required by the JDBC API onto the functionality provided by a specific kind of database.

简单地说,JDBC 驱动程序是一组类,它将 JDBC API 所需的功能映射到特定类型数据库提供的功能上。

Each database uses a different "wire protocol" to communicate between code running in a database client and the database server. JDBC "abstracts that away" so that a Java program can talk to any vendor's database (more or less1). The JDBC driver is the "glue" that makes the abstraction work.

每个数据库使用不同的“有线协议”在数据库客户端和数据库服务器中运行的代码之间进行通信。JDBC “将其抽象化”,以便 Java 程序可以与任何供应商的数据库(或多或少1)对话。JDBC 驱动程序是使抽象工作的“粘合剂”。

In the Oracle case, there are multiple JDBC drivers, for various purposes including

在 Oracle 案例中,有多个 JDBC 驱动程序,用于各种目的,包括

  • Thin drivers versus OCI or server-native drivers (OCI & server-native drivers depend on platform specific native libraries)
  • Client-side versus server-side drivers (server-side libraries are optimized for cases where the client code is running on the database server machine ... for example.)
  • Drivers for different versions of Java; e.g. supporting different JDBC conformance levels.
  • 瘦驱动程序与 OCI 或服务器本地驱动程序(OCI 和服务器本地驱动程序取决于平台特定的本地库)
  • 客户端与服务器端驱动程序(服务器端库针对客户端代码在数据库服务器机器上运行的情况进行了优化......例如。)
  • 不同版本Java的驱动程序;例如,支持不同的 JDBC 一致性级别。

The "ojdbc6.jar" file constitutes the Oracle thin client-side JDBC driver which is compatible with Java 6 (JDBC level 4.0).

“ojdbc6.jar”文件构成了与 Java 6(JDBC 级别 4.0)兼容的 Oracle 瘦客户端 JDBC 驱动程序。

For more information, read the Oracle JDBC FAQ.

有关更多信息,请阅读Oracle JDBC 常见问题解答



1 - There are a couple of issues that make cross-database compatibility difficulty. Firstly, different databases support different dialects of SQL and provide different sets of SQL data types. Secondly, certain database vendors (including Oracle, before they bought Sun) have implemented non-standard extensions to JDBC.

1 - 有几个问题使跨数据库兼容性变得困难。首先,不同的数据库支持不同的 SQL 方言,并提供不同的 SQL 数据类型集。其次,某些数据库供应商(包括 Oracle,在他们购买 Sun 之前)已经实现了对 JDBC 的非标准扩展。