什么是ojdbc6.jar文件? [英] What is ojdbc6.jar file?

查看:596
本文介绍了什么是ojdbc6.jar文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于学校项目,我必须用Java编写使用数据库的程序,为此,我必须将ojdbc6.jar导入到该项目文件中.我知道没有它我将无法使用数据库,但是我真的不知道这个文件是什么.有人可以解释吗?此类文件的调用方式及其用途是什么?

解决方案

简而言之,JDBC驱动程序是一组类,这些类将JDBC API所需的功能映射到特定类型的数据库提供的功能上.

每个数据库使用不同的有线协议"在数据库客户端中运行的代码与数据库服务器之间进行通信. JDBC可以抽象",以便Java程序可以与任何供应商的数据库进行通信(或多或少 1 ). JDBC驱动程序是使抽象起作用的胶水".

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

  • 瘦驱动程序与OCI或服务器本机驱动程序(OCI和服务器本机驱动程序取决于特定于平台的本机库)
  • 客户端驱动程序与服务器端驱动程序(例如,针对客户端代码在数据库服务器计算机上运行的情况进行了优化的服务器端库.)
  • 用于不同版本的Java的驱动程序;例如支持不同的JDBC一致性级别.

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

有关更多信息,请阅读 Oracle JDBC FAQ .


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

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?

解决方案

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.

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.

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

  • 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.

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

For more information, read the Oracle JDBC FAQ.


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.

这篇关于什么是ojdbc6.jar文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆