• 关于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多少种类型,这里给脑补一下,谁看到就好好看看那。另外原文中有标红的部分请注意一下。

  • 相关阅读:
    Android DSelectorBryant 单选滚动选择器
    Android BSearchEdit 搜索结果选择框
    Android TeaScreenPopupWindow多类型筛选弹框
    Android TeaPickerView数据级联选择器
    Android 兔子基金小工具
    Android 监听手机锁屏的工具类
    Android 弹出Dialog时隐藏状态栏和底部导航栏
    Android Studio 3.0+ Record Espresso Test 自动化测试
    Android GZIP压缩与解压
    体验 OpenDiablo2, 一款Golang开发的开源游戏
  • 原文地址:https://www.cnblogs.com/GYoungBean/p/3852706.html
Copyright © 2020-2023  润新知