oracle的oci和thin区别

常用的集成TTL门电路 本篇主要分析了常用的逻辑门电路与非门,详细分析了电源原理。值得收藏。 阅读详情

我是今天看到tomcat数据源的配置时,想起来这个问题,刚开始还不晓得thin是什么东西!

  database.url=jdbc:oracle:thin:angel/oracle@192.168.55.11:1530:monitordb

  经过上网查询,得到如下结果:

  jdbc:oracle连接的是oracle数据库

  thin是一种方法

  angel/oracle那个angel是用户名,oracle是密码

  192.168.55.11是你要连的电脑ip

  1530是oracle的连端口(1521貌似是默认端口)

  monitordb这是数据库的名字

  下面是我转载的文章,是关于tomcat数据源中oracle的oci和thin区别:

  前几天同事跑过来跟我说, 机房中的一台tomcat服务器跟oracle数据库机连接很慢,查看控制台中的hibernate日志, 基本上是一条sql出来要等个1-2秒再出第二条。但同样的程序在他自己机器上的tomcat运行,同样是连那台数据库机器,就快很多,不会出现前面的每执行1条sql就卡一次壳的情况。

  初步分析,我就想到可能是网络原因, 机房两台机器连接不畅通, 程序和机器差的原因基本可以排除, 机房的tomcat机比我们开发机要强多了, 而且程序在他的机器上运行又没有问题。于是我就劝他到机房去检查一下网络状态, 但他一时也无法进入,因为机房的管理人员不在。

  过了一会, 他告诉我问题解决了, 把数据库访问的url更换成了oci方式就好了, oci对我来说有些陌生, 我一直是用的thin,也没想过其他连接方式。对于oci我也只能想到oracle 的client中貌似是有oci什么的,当时有其他事情也没管了。

  今天有意了解一下区别,先看看thin和oci的url写法上的区别:jdbc:oracle:thin:@server ip: service jdbc:oracle:oci:@service看来oci的还更加简洁,ip可以省掉不写了。

  接下来再找找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.

  这下基本明白了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,但找了半天没有找到相关的测试报告。

西门子S7-200 SMART与施耐德ATV变频器Modbus通讯实战:从接线到稳定运行的完整指南 本文详细介绍了西门子S7-200 SMART PLC与施耐德ATV变频器之间实现稳定Modbus通讯的完整实战指南。内容涵盖从硬件接线、参数配置、PLC程序编写到触摸屏设计的全流程,并分享了提升通讯稳定性的关键技巧和常见故障排查方法,助力工业自动化系统可靠运行。 阅读详情

相关推荐

从ESP/ABS选型看轮速传感器:为什么你的车用了AK+PWM+7/14mA三种协议?

本文深入解析了汽车轮速传感器的三种主流协议(7/14mA电流型、PWM型和AK协议型)及其混合应用场景。通过对比不同协议的技术特点、成本效益和工程挑战,揭示了现代车辆采用多种传感器协议背后的设计逻辑,包括成本控制、性能平衡和冗余设计等关键因素。

weixin_29266679的博客 534

oracle的驱动的功能吗,oralce的各种数据库驱动程序的区别

weblogic数据源配置时,数据库类型是oralce的各种数据库驱动程序的区别第一种:JDBC Thin驱动:thin是for thin client的意思,这种驱动一般用在运行在WEB浏览器中的JAVA程序。它不是通过OCI or Net8,而是通过Java sockets进行通信,是纯java实现的驱动,因此不需要在使用JDBC Thin的客户端机器上安装orcale 客户端软件,所以有很好...

weixin_39606003的博客 392

suse ha for sap scale-up性能优化场景安装配置

suse ha for SAP安装配置

jetliu05的博客 2141

thin driver连接 Oracle RAC jdbcUR写法

jdbc:oracle:thin:@(description=(address_list= (address=(host=x1) (protocol=tcp)(port=1521))(address=(host=x2)(protocol=tcp) (port=1521)) (load_balance=yes)(failover=yes))(connect_data=(servic...

iteye_14791的博客 279

5步搞定ABB机器人RobotStudio与S7-1500PLC的Profinet通讯(附PLCSIM调试技巧)

本文详细介绍了如何利用RobotStudio与TIA Portal软件,结合PLCSIM Advanced仿真器,在零硬件条件下实现ABB机器人与西门子S7-1500 PLC之间的Profinet通讯虚拟调试。通过五个核心步骤,从环境搭建、网络配置、信号映射到联合仿真与高级调试,帮助工程师在项目前期高效验证逻辑、压缩现场调试周期,并掌握实用的PLCSIM调试技巧。

weixin_29188043的博客 506

Spacedesk保姆级教程:用旧平板给Windows电脑当副屏,从安装到避坑一步到位

本文提供Spacedesk保姆级教程,教你如何将旧平板变成Windows电脑的副屏,从软件安装到网络配置、显示优化及声音交互,一步步避开常见陷阱。通过WiFi实现扩展屏功能,支持4K分辨率和60Hz刷新率,让闲置设备焕发新生。

weixin_42524945的博客 1万+

ORACLE驱动thin方式动态切换客户端字符集实现

为什么80%的码农都做不了架构师?>>> ...

weixin_33672109的博客 883

SDN:使用Postman控制ODL查看和下发流表

所谓,其实可被视作是SDN对网络设备的数据转发功能的一种抽象。在传统网络设备中,交换机和路由器的数据转发需要依赖设备中保存的二层MAC地址转发表或者三层的IP地址路由表,SDN交换机中使用的流表也是如此,不过在它的表项中整合了网络中各个层次的网络配置信息,从而在进行数据转发时可以使用更丰富的规则。其流表中的每个表项结果如下图所示:OpenFlow1.3流表的每个表项由6部分组成:1、匹配域:匹配域即OpenFlow1.0流表中的包头域,用于对交换机接收到的数据包的包头内容进行匹配。Ehter Des。

lyhaoyuhangyuan的博客 2535

Oracle的thin驱动和oci驱动有什么不同?哪个性能好些?

OCI:要安装ORACLE客户端,移植性略差,理论上性能好些 THIN:属于TYPE4,纯JAVA实现,移植性好,理论上性能略差些 推荐:最好还是使用THIN   DRIVER吧,移植性好些,使用起来也相对规范些,问题也少。至于性能嘛,说实话,在8i上没感觉THIN   DRIVER比OCI慢,感觉还快些。不过没有实际准确测试过,也不敢下定论。为什么呢,调用本地方法也是有开销的,JDK性能越来越好...

weixin_33797791的博客 178

避开这些坑!baostock获取股票数据时最容易犯的5个错误(Python实战)

本文针对使用Python和baostock库获取股票历史数据时常见的五大陷阱,提供了实战解决方案。重点剖析了登录状态验证、参数配置、数据解析、批量操作效率及数据一致性校验等关键环节,帮助开发者构建稳健高效的数据获取流程,避免因细节疏忽导致的数据错误或性能瓶颈。

websocket5live的博客 1443

深入理解C语言内存管理:堆与栈的区别

栈是一种遵循后进先出(LIFO)原则的数据结构。在程序中,栈用于存储局部变量、函数的参数以及函数调用时的返回地址等信息。栈的内存管理由操作系统自动进行,每次函数调用时都会在栈上分配一块内存区域,函数执行完毕后,该内存区域会自动释放。在C语言中,堆与栈是两种不同的内存分配方式,各自有着不同的特点和适用场景。栈内存自动管理,访问速度快,但大小有限,适用于存储局部变量和函数调用信息。堆内存由程序员手动管理,适用于存储动态数据结构,大小不受限制,但访问速度较慢,容易导致内存泄漏等问题。

set_one的博客 1582

oracle oci的好处,oracle的oci和thin区别

我是今天看到tomcat数据源的配置时,想起来这个问题,刚开始还不晓得thin是什么东西!database.url=jdbc:oracle:thin:angel/oracle@192.168.55.11:1530:monitordb经过上网查询,得到如下结果:jdbc:oracle连接的是oracle数据库thin是一种方法angel/oracle那个angel是用户名,oracle是密码192....

weixin_28882103的博客 1382

手把手教你学Simulink——基于Simulink的无感FOC(滑模观测器+PLL)实战

摘要: 本文详细介绍了基于Simulink的无感FOC(滑模观测器+PLL)实现方法。主要内容包括:1)SMO+PLL原理,通过滑模观测器估算反电动势,结合PLL抑制抖振;2)系统架构,替代编码器信号;3)Simulink建模流程,涵盖Clarke变换、SMO离散化实现、PLL设计等关键步骤;4)参数整定指南和工程实践要点,如启动策略和故障处理。该方法具有成本低、可靠性高的优势,适用于家电、电动车等场景,仿真结果显示角度误差±5°,速度动态跟随良好。文章还提供了调试建议和常见问题解决方案。

MHD0815的博客 140

转载:oracle oci和thin的区别

 声明:本文章转自http://www.233.com/oracle/jishu/20111011/15581766.html 我浏览网页的时候,发现这篇文章不错,故转载。 我是今天看到tomcat数据源的配置时,想起来这个问题,刚开始还不晓得thin是什么东西!   database.url=jdbc:oracle:thin:angel/oracle@192.168.

KCal的专栏 882

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

oracle的oci和thin区别(数据源)

我是今天看到tomcat数据源的配置时,想起来这个问题,刚开始还不晓得thin是什么东西! database.url=jdbc:oracle:thin:angel/oracle@192.168.55.11:1530:monitordb 经过上网查询,得到如下结果: jdbc

小菜鸟的天地 8272

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

Oracle的OCI和Thin区别

Oracle的OCI和Thin区别: 1)连接 jdbc:oracle:thin:@server ip: service jdbc:oracle:oci:@service 2)从使用上来说,oci必须在客户机上安装oracle客户端或才能连接,而thin就不需要,因此

Chen_Weihappy_love的专栏 1377

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

oracle url中的oci和thin区别

我是今天看到tomcat数据源的配置时,想起来这个问题,刚开始还不晓得thin是什么东西!   database.url=jdbc:oracle:thin:angel/oracle@192.168.55.11:1530:monitordb   经过上网查询,得到如下结果:   jdbc:oracle连接的是oracle数据库   thin是一种方法   angel/o...

zengzp1994的博客 551

oracle thin和oci 区别

Features of ORACLE JDBC Drivers: 1.JDBC Oci 此驱动类似于传统的ODBC 驱动。因为它需要Oracle Call Interface and Net8,所以它需要在运行使用此驱动的JAVA程序的机器上安装客户端软件   2.JDBC Thin 这种驱动一般用在运行在WEB浏览器中的JAVA程序。它不是通过OCI or Net8,而是通过Java so

u012189294的专栏 2594

Java连接Oracle两种方式thin与oci区别

初步分析,我就想到可能是网络原因, 机房两台机器连接不畅通, 程序和机器差的原因基本可以排除, 机房的tomcat机比我们开发机要强多了, 而且程序在他的机器上运行又没有问题。过了一会, 他告诉我问题解决了, 把数据库访问的url更换成了oci方式就好了, oci对我来说有些陌生, 我一直是用的thin,也没想过其他连接方式。1)从使用上来说,oci必须在客户机上安装oracle客户端或才能连接,而thin就不需要,因此从使用上来讲thin还是更加方便,这也是thin比较常见的原因。

源辰_付鹏程 1231

oracle连接两种方式thin与oci区别

 Java连接Oracle两种方式thin与oci区别 前几天同事跑过来跟我说, 机房中的一台tomcat服务器跟oracle数据库机连接很慢,查看控制台中的hibernate日志, 基本上是一条sql出来要等个1-2秒再出第二条。但同样的程序在他自己机器上的tomcat运行,同样是连那台数据库机器,就快很多,不会出现前面的每 执行1条sql就卡一次壳的情况。  初步分析,我就想到可能是

kevin_pso的博客 1万+
上一篇: proxool的oracle配置
下一篇: ztree数据库交互
zi_jun
博客等级 码龄18年 109粉丝 7原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值