zoukankan      html  css  js  c++  java
  • 关于JDBC

    脑补一下JDBC基础知识,原文链接:http://docs.oracle.com/javase/tutorial/jdbc/basics/gettingstarted.html

    If you are using Java DB, it already comes with a JDBC driver. If you are using MySQL, install the latest version of Connector/J.
    
    Contact the vendor of your database to obtain a JDBC driver for your DBMS.
    
    There are many possible implementations of JDBC drivers. These implementations are categorized as follows:
    
    Type 1: Drivers that implement the JDBC API as a mapping to another data access API, such as ODBC (Open Database Connectivity). Drivers of this type are generally dependent on a native library, which limits their portability. The JDBC-ODBC Bridge is an example of a Type 1 driver.
    
    Note: The JDBC-ODBC Bridge should be considered a transitional solution. It is not supported by Oracle. Consider using this only if your DBMS does not offer a Java-only JDBC driver.
    
    Type 2: Drivers that are written partly in the Java programming language and partly in native code. These drivers use a native client library specific to the data source to which they connect. Again, because of the native code, their portability is limited. Oracle's OCI (Oracle Call Interface) client-side driver is an example of a Type 2 driver.
    
    Type 3: Drivers that use a pure Java client and communicate with a middleware server using a database-independent protocol. The middleware server then communicates the client's requests to the data source.
    
    Type 4: Drivers that are pure Java and implement the network protocol for a specific data source. The client connects directly to the data source.
    
    Check which driver types comes with your DBMS. Java DB comes with two Type 4 drivers, an Embedded driver and a Network Client Driver. MySQL Connector/J is a Type 4 driver.
    
    Installing a JDBC driver generally consists of copying the driver to your computer, then adding the location of it to your class path. In addition, many JDBC drivers other than Type 4 drivers require you to install a client-side API. No other special configuration is usually needed.

    PS:天天群里吵吵什么JDBC多少种类型,这里给脑补一下,谁看到就好好看看那。另外原文中有标红的部分请注意一下。

  • 相关阅读:
    英雄联盟离线更新方法
    (七) Keras 绘制网络结构和cpu,gpu切换
    剑指offer | 链表中的倒数第K个结点 | 12
    剑指offer | 从尾到头打印链表 | 11
    剑指offer | 栈的压入,弹出序列 | 10
    剑指offer | 包含min函数的栈 | 09
    剑指offer | 调整数组顺序使奇数位于偶数前面 | 08
    剑指offer | 旋转数组的最小数字 | 07
    剑指offer | 两个栈实现一个队列 | 06
    剑指offer | 替换空格 | 05
  • 原文地址:https://www.cnblogs.com/GYoungBean/p/3852706.html
Copyright © 2011-2022 走看看