JDBC数据库驱动程序种类及选择
现在目前数据库驱动程序市场上,JDBC数据库驱动程序主要有四个类型。这个四个类型的驱动程序各有各的特点,并不能够说哪一个
现在目前数据库驱动程序市场上,JDBC数据库驱动程序主要有四个类型。这个四个类型的驱动程序各有各的特点,并不能够说哪一个最好。
现在目前数据库驱动程序市场上,JDBC数据库驱动程序主要有四个类型。这个四个类型的驱动程序各有各的特点,并不能够说哪一个最好。数据库管理员需要结合企业的实际情况,才能够选择一个合适的数据库驱动类型。下面笔者就JDBC数据库驱动程序,来谈谈这个四个类型的JDBC各具有什么样的特点,适合在什么样的情况下使用。
类型一:厂商提供专属JDBC驱动程序
有些厂商如Oracle或者SYBASE,这些数据库厂商他们自己开发了一些JDBC驱动程序。这个类型的JDBC驱动程序会将JDBC调用直接转换为关系数据库本身使用的通信协议。换一句话说,应用程序客户端可以直接与数据库创建连接。这种类型的JDBC驱动程序主要有如下几个特点。
一是JDBC驱动程序是数据库厂商提供的,所以应用程序可以直接跟数据库进行连接,其执行性能要比其他类型的JDBC数据库驱动程序要好,比ODBC数据库驱动程序也要好。目前已经有很多数据库厂商提供专属的JDBC驱动程序,,如甲骨文公司的Oracle数据库产品,如微软公司的SQL Server等等。
二是往往这类JDBC驱动程序全部是由JAVA程序开发的,而不是有C语言开发的。为此这类驱动程序往往跨平台的性能比较好,可以在多个操作系统平台上运行。为此如果企业在Linux等非微软的操作系统上部署数据库应用,那么采用这种类型的数据库驱动程序是一个明智的选择。
三是这类驱动程序缺乏弹性。由于是数据库厂商自己提供的专属驱动程序,为此往往只适用于自己的数据库系统,甚至只适合某个版本的数据库系统。如果后台数据库换了一个或者版本升级了,则就有可能需要更换数据库驱动程序。这一个缺陷,是限制这个类型的数据库驱动程序应用的最大障碍之一。不过根据笔者的经验,如果企业的数据库应用主要是在企业局域网内部使用,则这个问题不会很大。因为此时企业往往不会随意更换数据库系统,或者对数据库系统进行升级。为此也就会不会因为这个数据库驱动程序弹性不好而给日后的工作带来麻烦。
为此笔者建议,如果企业的数据库应用相对稳定,那么在数据库开发或者部署的时候,最好使用厂商提供的专属JDBC驱动程序。因为这个类型的数据库驱动程序其与数据库之间的连接最直接,其执行性能最好。不过其前提是数据库厂商提供了这种类型的JDBC驱动程序。据笔者了解,像开源的MySQL数据库好像还没有提供专属的JDBC驱动程序。如果数据库管理员在MySQL数据库平台上部署应用的话,则即使想采用专属JDBC数据库驱动程序也是行不通的。此时可能管理员要采用其他类型的JDBC数据库驱动程序。
类型二:三层式架构的JDBC驱动程序。
这种三层式架构的JDBC驱动程序主要采用间接连接方式来连接数据库。首先JDBC数据库驱动程序会先将JDBC函数调用翻译成与数据库无关的网络通信协议。其次由一个叫做中介层服务器的部件会充当翻译家的角色,会对这些报文进行翻译。最后JDBC才把这部分内容转换成相对应的关系型数据库通信协议。也就是说,在客户端与数据库服务器之间有一个中介服务器的角色,客户端与服务器之间的通信需要通过这个中介服务器来进行。
这个类型的JDBC数据库驱动类型有如下几个特点。
一是提供了比较好的扩展性。如当某些原因下需要更换后台数据库的时候,只需要调整中介层与数据库之间的JDBC驱动程序即可。而对于前端的应用程序的负面影响可以降至到最低。在大部分情况下,前端的应用程序基本上不需要调整;有些只需要重新指定所采用的后台数据库即可。
二是这个JDBC驱动程序也是百分之百利用JAVA语言进行编写的。为此如果采用的应用程序开发平台也是JAVA的话,那么无疑他们之间的兼容性会很好。所以如果采用的是JDeveloper等JAVA开发平台的话,这种类型的数据库驱动程序能够为数据库开发人员提供比较稳定的开发平台。
三是在性能上,其不甚理想。由于采用三层式架构的JDBC数据库驱动程序,其需要通过中介服务器角色来访问数据库。虽然这种架构提供了比较高的扩展性,但是其执行性能的话就受到了影响。在同等条件下,这种类型的数据库驱动程序其执行性能没有专属JDBC驱动程序好。鱼与熊掌不能够兼得,数据库开发人员需要在性能与扩展性上做出一个艰难的抉择。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

After Java8-291, TLS1.1 is disabled, so that JDBC cannot connect to SqlServer2008 using SSL. What should I do? The following is the solution to modify the java.security file 1. Find the java.security file of jre. If it is jre, go to {JAVA_HOME}/jre/ In lib/security, for example????C:\ProgramFiles\Java\jre1.8.0_301\lib\security. If it is the Eclipse green installation-free portable version, search for java.security in the installation folder, such as????xxx\plugins \org

In the CentOS operating system, Sysdig is a powerful system debugging and monitoring tool. It can help users deeply understand the operation of the system and provide detailed performance analysis. System_call_fastpath is a feature of the CentOS kernel that can speed up system calls. To improve system performance, this article will introduce how to install Sysdig and enable the system_call_fastpath feature on CentOS. Sysdig is an open source system debugging and monitoring tool that can capture the running status of the system and provide detailed performance analysis. The following are the steps to install Sysdig on CentOS: 1. Update the system software package:

With the widespread application of Java, JDBC errors often occur when Java programs connect to databases. JDBC (JavaDatabaseConnectivity) is a programming interface in Java used to connect to a database. Therefore, a JDBC error is an error encountered when a Java program interacts with a database. Here are some of the most common JDBC errors and how to solve and avoid them. ClassNotFoundException This is the most common JDBC

In recent years, the application of Java language has become more and more widespread, and JDBCAPI is a creative method for Java applications to interact with databases. JDBC is based on an open database connection standard called ODBC, which enables Java applications to connect to any database. management system (DBMS). Among them, MySQL is a popular database management system. However, developers will also encounter some common problems when connecting to MySQL databases. This article aims to introduce the JDBCAPI connection M

1. Explain that in JDBC, the executeBatch method can execute multiple dml statements in batches, and the efficiency is much higher than executing executeUpdate individually. What is the principle? How to implement batch execution in mysql and oracle? This article will introduce to you the principle behind this. 2. Experiment introduction This experiment will be carried out through the following three steps: a. Record the time consuming of jdbc batch execution and single execution in mysql; b. Record the time consuming of jdbc batch execution and single execution in oracle; c. Record the batch execution and single execution of oracleplsql. The execution time-consuming related java and database versions are as follows: Java17, Mysql8, Oracle

1. Prerequisites for database programming Programming languages, such as Java, C, C++, Python and other databases, such as Oracle, MySQL, SQLServer and other database driver packages: Different databases provide different database driver packages corresponding to different programming languages. For example: MySQL provides the Java driver package mysql-connector-java, which is required to operate MySQL based on Java. Similarly, to operate Oracle database based on Java, Oracle's database driver package ojdbc is required. 2. Java database programming: JDBCJDBC, JavaDatabaseConnectiv

As an open source operating system, CentOS is widely used in servers and development environments, and KDevelop is a powerful integrated development environment that can provide a wealth of development tools and plug-ins to enable developers to develop software more efficiently. In this article, we will introduce how to install KDevelop on CentOS, and also introduce how to install a virtual machine on CentOS. KDevelop is an integrated development environment based on KDE, which provides a wealth of functions and tools and is suitable for the development of C, C++, Python and other programming languages. The following are the steps to install KDevelop on CentOS: 1. Open the terminal and use the following Command to install KDevelop

CentOS is a Linux-based operating system that is widely used in servers and enterprise applications. Sentaurus is a semiconductor device simulation software used to design and optimize semiconductor devices. In this article, we will discuss how to install Sentaurus on CentOS. And solve the problem of installing boot loader error. CentOS installation Sentaurus Sentaurus is a commercial software, so before installation, you need to obtain the installation file from the official website or other legal channels. The following are the steps to install Sentaurus on CentOS: 1. Download the Sentaurus installation file: from the official website or other legal channels Channel download Sentau
