//看看thin和oci的url写法上的区别: jdbc:oracle:thin:@server ip: service jdbc:oracle:oci:@service
/* 1)从使用上来说,oci必须在客户机上安装oracle客户端或才能连接,而thin就不需要,因此从使用上来讲thin还是更加方便,这也是thin比较常见的原因。 2)原理上来看,thin是纯java实现tcp/ip的c/s通讯; 而oci方式,客户端通过native java method调用c library访问服务端,而这个c library就是oci(oracle called interface),因此这个oci总是需要随着oracle客户端安装(从oracle10.1.0开始,单独提供OCI Instant Client,不用再完整的安装client) 3)它们分别是不同的驱动类别,oci是二类驱动, thin是四类驱动,但它们在功能上并无差异。 4)虽然很多人说oci的速度快于thin,但找了半天没有找到相关的测试报告。 */
//官方描述 Oracle provides four different types of JDBC drivers, for use in different deployment scenarios. The 10.1.0 drivers can access Oracle 8.1.7 and higher. While all Oracle JDBC drivers are similar, some features apply only to JDBC OCI drivers and some apply only to the JDBC Thin driver. JDBC OCI client-side driver: This is a JDBC Type 2 driver that uses Java native methods to call entrypoints in an underlying C library. That C library, called OCI (Oracle Call Interface), interacts with an Oracle database. The JDBC OCI driver requires an Oracle client installation of the same version as the driver. The use of native methods makes the JDBC OCI driver platform specific. Oracle supports Solaris, Windows, and many other platforms. This means that the Oracle JDBC OCI driver is not appropriate for Java applets, because it depends on a C library. Starting from 10.1.0, the JDBC OCI driver is available for install with the OCI Instant Client feature, which does not require a complete Oracle client-installation. Please refer to Oracle Call Interface for more information. JDBC Thin client-side driver: This is a JDBC Type 4 driver that uses Java to connect directly to Oracle. It implements Oracle's SQL*Net Net8 and TTC adapters using its own TCP/IP based Java socket implementation. The JDBC Thin driver does not require Oracle client software to be installed, but does require the server to be configured with a TCP/IP listener. Because it is written entirely in Java, this driver is platform-independent. The JDBC Thin driver can be downloaded into any browser as part of a Java application. (Note that if running in a client browser, that browser must allow the applet to open a Java socket connection back to the server.) JDBC Thin server-side driver: This is another JDBC Type 4 driver that uses Java to connect directly to Oracle. This driver is used internally within the Oracle database. This driver offers the same functionality as the client-side JDBC Thin driver (above), but runs inside an Oracle database and is used to access remote databases. Because it is written entirely in Java, this driver is platform-independent. There is no difference in your code between using the Thin driver from a client application or from inside a server. 连接方式有以下几种: Oralce provides four types of JDBC driver. Thin Driver, a 100% Java driver for client-side use without an Oracle installation, particularly with applets. The Thin driver type is thin. To connect user scott with password tiger to a database with SID (system identifier) orcl through port 1521 of host myhost, using the Thin driver, you would write : Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@myhost:1521:orcl", "scott", "tiger"); OCI Driver for client-side use with an Oracle client installation. The OCI driver type is oci. To connect user scott with password tiger to a database with SID (system identifier) orcl through port 1521 of host myhost, using the OCI driver, you would write : Connection conn = DriverManager.getConnection ("jdbc:oracle:oci:@myhost:1521:orcl", "scott", "tiger"); Note that you can also specify the database by a TNSNAMES entry. You can find the available TNSNAMES entries listed in the file tnsnames.ora on the client computer from which you are connecting. For example, if you want to connect to the database on host myhost as user scott with password tiger that has a TNSNAMES entry of MyHostString, enter: Connection conn = DriverManager.getConnection ("jdbc:oracle:oci8:@MyHostString","scott","tiger"); If your JDBC client and Oracle server are running on the same machine, the OCI driver can use IPC (InterProcess Communication) to connect to the database instead of a network connection. An IPC connection is much faster than a network connection. Connection conn = DriverManager.getConnection ("jdbc:oracle:oci8:@","scott","tiger"); Server-Side Thin Driver, which is functionally the same as the client-side Thin driver, but is for code that runs inside an Oracle server and needs to access a remote server, including middle-tier scenarios. The Server-Side Thin driver type is thin and there is no difference in your code between using the Thin driver from a client application or from inside a server. Server-Side Internal Driver for code that runs inside the target server, that is, inside the Oracle server that it must access. The Server-Side Internal driver type is kprb and it actually runs within a default session. You are already "connected". Therefore the connection should never be closed. To access the default connection, write: DriverManager.getConnection("jdbc:oracle:kprb:"); or: DriverManager.getConnection("jdbc:default:connection:"); You can also use the Oracle-specific defaultConnection() method of the OracleDriver class which is generally recommended: OracleDriver ora = new OracleDriver(); Connection conn = ora.defaultConnection(); Note: You are no longer required to register the OracleDriver class for connecting with the Server-Side Internal driver, although there is no harm in doing so. This is true whether you are using getConnection() or defaultConnection() to make the connection. Any user name or password you include in the URL string is ignored in connecting to the server default connection. The DriverManager.getConnection() method returns a new Java Connection object every time you call it. Note that although the method is not creating a new physical connection (only a single implicit connection is used), it is returning a new object. Again, when JDBC code is running inside the target server, the connection is an implicit data channel, not an explicit connection instance as from a client. It should never be closed.
另转一篇:不安装Oracle客户端远程连接Orcale数据库
http://blog.csdn.net/shenyc/archive/2009/10/28/4737937.aspx
您还没有登录,请您登录后再发表评论
例如:jdbc:oracle:thin:@localhost:1521:testdb jdbc:oracle:thin:root/secret@localhost:1521:testdb jdbc:oracle:oci:@hoststring jdbc:oracle:oci:@localhost:1521:testdb jdbc:oracle:oci:root/secret@host...
在Java连接Oracle数据库时,主要通过两种类型的驱动程序:OCI和Thin。OCI是Oracle提供的本地库接口,它提供了一种高效、低延迟的方式与Oracle数据库交互,特别适合于需要高性能的应用场景。而Thin驱动则是一种纯Java...
oracle的oci和thin连接的区别 1)从使用上来说,oci必须在客户机上安装oracle客户端或才能连接,而thin就不需要,因此从使用上来讲thin还是更加方便,这也是thin比较常见的原因。 2)原理上来看,thin是纯java实现...
总结来说,`ojdbc6-11.2.0.4.0-atlassian-hosted.jar`是Oracle数据库的JDBC Thin驱动,适用于Java 6环境,用于在Java应用程序中连接和操作Oracle 11g数据库。开发者需要将此驱动包添加到项目类路径,并使用Java的...
Oracle数据库驱动,全称为Oracle JDBC驱动,是Java应用程序与Oracle数据库之间进行通信的关键组件。它遵循Java Database Connectivity (JDBC) API规范,使得Java开发者能够使用SQL语句执行数据库操作,如查询、插入...
本文主要探讨的是Java连接Oracle数据库的方法,包括JDBC和SQLJ,以及Oracle JDBC驱动的三种类型。 首先,Java与Oracle的接口使得在数据库中运行Java成为可能。Oracle8i引入了这一特性,允许开发者在应用程序中利用...
本文对基于跨平台的Oracle数据库连接进行了综合和详细的分析和研究。首先讨论了连接的各种方式及Java实现,分析了其优缺点。针对连接池的缺点提出了采用多连接池、多进程、多线程方法技术来解决多数据源连接、稳定...
Oracle JDBC驱动程序是Oracle公司提供的实现JDBC规范的软件,分为thin、thin with OCI(Oracle Call Interface)、 DriverManager和JNDI(Java Naming and Directory Interface)四种类型,其中thin驱动是最常用的,...
3. **Native SQL API驱动**:这个驱动提供对Oracle数据库特定功能的直接访问,如PL/SQL块和Oracle数据类型。 4. **Oracle Call Interface (OCI) 驱动**:这需要本地Oracle客户端库,提供了对Oracle高级特性的全面...
Oracle数据库采用SQL(Structured Query Language)作为其主要的数据查询和操作语言,同时支持多种编程接口,包括OCI(Oracle Call Interface)、Pro*C/C++、PL/SQL等,使开发者能够灵活地与数据库进行交互。...
Oracle数据库是全球最广泛使用的商业关系型数据库管理系统之一,它提供了强大的数据存储、处理和管理功能。在Java编程环境中,Oracle提供了对应的JAR文件来支持Java应用程序与Oracle数据库的交互。"oracle.jar"是一...
使用thin driver,Java应用程序可以直接通过网络与Oracle数据库服务器通信。主要的JAR文件是`ojdbc.jar`,例如`ojdbc8.jar`或`ojdbc7.jar`,具体版本取决于你的Oracle数据库版本。 2. ** JDBC OCI Driver (Oracle ...
"class12(oracle数据库连接hibernate驱动程序)"这个标题暗示了我们将讨论如何配置和使用Oracle驱动来实现Hibernate对Oracle数据库的连接。 首先,我们需要了解Oracle JDBC驱动。Oracle提供了多种类型的JDBC驱动,...
#### 二、Oracle数据库驱动及URL配置 ##### 1. 驱动名称: - **驱动文件**:`ojdbc14.jar` - **驱动类**:`oracle.jdbc.driver.OracleDriver` ##### 2. JDBC URL格式: - **thin模式**: ``` jdbc:oracle:...
Oracle数据库是全球广泛使用的商业关系型数据库管理系统,而2000和2005可能指的是Oracle数据库的版本年份,如Oracle 9i(2000年发布)和Oracle 10g(2005年发布)。这些版本都有对应的JDBC驱动程序,即Java Database...
ojdbc14.jar中的驱动属于Thin驱动,它是一个纯Java实现,不需要Oracle客户端软件,因此可以在任何支持Java的环境中运行,这使得远程访问Oracle数据库变得更加便捷。 在使用ojdbc14.jar之前,我们需要将其添加到Java...
1. `ojdbc.jar`:这是Oracle JDBC Thin Driver的主要库,包含了连接Oracle数据库所需的类和方法。 2. `classes12.jar`:这个文件在较旧的Oracle版本中常见,包含了一些额外的非JDBC接口,可能在某些特定场景下需要...
总之,ojdbc6-12.1.0.1.zip是Java开发者连接Oracle 12c数据库的重要工具,它的使用涉及到Java编程、Oracle数据库知识、JDBC接口和数据库连接管理等多个方面,理解并掌握这些知识点对提升开发效率和应用性能至关重要...
3. **Oracle数据库URL格式** Oracle数据库的JDBC URL通常遵循以下格式: ``` jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=hostname)(PORT=port))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_...
相关推荐
例如:jdbc:oracle:thin:@localhost:1521:testdb jdbc:oracle:thin:root/secret@localhost:1521:testdb jdbc:oracle:oci:@hoststring jdbc:oracle:oci:@localhost:1521:testdb jdbc:oracle:oci:root/secret@host...
在Java连接Oracle数据库时,主要通过两种类型的驱动程序:OCI和Thin。OCI是Oracle提供的本地库接口,它提供了一种高效、低延迟的方式与Oracle数据库交互,特别适合于需要高性能的应用场景。而Thin驱动则是一种纯Java...
oracle的oci和thin连接的区别 1)从使用上来说,oci必须在客户机上安装oracle客户端或才能连接,而thin就不需要,因此从使用上来讲thin还是更加方便,这也是thin比较常见的原因。 2)原理上来看,thin是纯java实现...
总结来说,`ojdbc6-11.2.0.4.0-atlassian-hosted.jar`是Oracle数据库的JDBC Thin驱动,适用于Java 6环境,用于在Java应用程序中连接和操作Oracle 11g数据库。开发者需要将此驱动包添加到项目类路径,并使用Java的...
Oracle数据库驱动,全称为Oracle JDBC驱动,是Java应用程序与Oracle数据库之间进行通信的关键组件。它遵循Java Database Connectivity (JDBC) API规范,使得Java开发者能够使用SQL语句执行数据库操作,如查询、插入...
本文主要探讨的是Java连接Oracle数据库的方法,包括JDBC和SQLJ,以及Oracle JDBC驱动的三种类型。 首先,Java与Oracle的接口使得在数据库中运行Java成为可能。Oracle8i引入了这一特性,允许开发者在应用程序中利用...
本文对基于跨平台的Oracle数据库连接进行了综合和详细的分析和研究。首先讨论了连接的各种方式及Java实现,分析了其优缺点。针对连接池的缺点提出了采用多连接池、多进程、多线程方法技术来解决多数据源连接、稳定...
Oracle JDBC驱动程序是Oracle公司提供的实现JDBC规范的软件,分为thin、thin with OCI(Oracle Call Interface)、 DriverManager和JNDI(Java Naming and Directory Interface)四种类型,其中thin驱动是最常用的,...
3. **Native SQL API驱动**:这个驱动提供对Oracle数据库特定功能的直接访问,如PL/SQL块和Oracle数据类型。 4. **Oracle Call Interface (OCI) 驱动**:这需要本地Oracle客户端库,提供了对Oracle高级特性的全面...
Oracle数据库采用SQL(Structured Query Language)作为其主要的数据查询和操作语言,同时支持多种编程接口,包括OCI(Oracle Call Interface)、Pro*C/C++、PL/SQL等,使开发者能够灵活地与数据库进行交互。...
Oracle数据库是全球最广泛使用的商业关系型数据库管理系统之一,它提供了强大的数据存储、处理和管理功能。在Java编程环境中,Oracle提供了对应的JAR文件来支持Java应用程序与Oracle数据库的交互。"oracle.jar"是一...
使用thin driver,Java应用程序可以直接通过网络与Oracle数据库服务器通信。主要的JAR文件是`ojdbc.jar`,例如`ojdbc8.jar`或`ojdbc7.jar`,具体版本取决于你的Oracle数据库版本。 2. ** JDBC OCI Driver (Oracle ...
"class12(oracle数据库连接hibernate驱动程序)"这个标题暗示了我们将讨论如何配置和使用Oracle驱动来实现Hibernate对Oracle数据库的连接。 首先,我们需要了解Oracle JDBC驱动。Oracle提供了多种类型的JDBC驱动,...
#### 二、Oracle数据库驱动及URL配置 ##### 1. 驱动名称: - **驱动文件**:`ojdbc14.jar` - **驱动类**:`oracle.jdbc.driver.OracleDriver` ##### 2. JDBC URL格式: - **thin模式**: ``` jdbc:oracle:...
Oracle数据库是全球广泛使用的商业关系型数据库管理系统,而2000和2005可能指的是Oracle数据库的版本年份,如Oracle 9i(2000年发布)和Oracle 10g(2005年发布)。这些版本都有对应的JDBC驱动程序,即Java Database...
ojdbc14.jar中的驱动属于Thin驱动,它是一个纯Java实现,不需要Oracle客户端软件,因此可以在任何支持Java的环境中运行,这使得远程访问Oracle数据库变得更加便捷。 在使用ojdbc14.jar之前,我们需要将其添加到Java...
1. `ojdbc.jar`:这是Oracle JDBC Thin Driver的主要库,包含了连接Oracle数据库所需的类和方法。 2. `classes12.jar`:这个文件在较旧的Oracle版本中常见,包含了一些额外的非JDBC接口,可能在某些特定场景下需要...
总之,ojdbc6-12.1.0.1.zip是Java开发者连接Oracle 12c数据库的重要工具,它的使用涉及到Java编程、Oracle数据库知识、JDBC接口和数据库连接管理等多个方面,理解并掌握这些知识点对提升开发效率和应用性能至关重要...
3. **Oracle数据库URL格式** Oracle数据库的JDBC URL通常遵循以下格式: ``` jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=hostname)(PORT=port))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_...