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

  • 相关阅读:
    java--递归删除目录
    java--获取文件夹大小
    我经历中最重要的三位老师
    我的自我介绍
    如何判断多选框是否选中?
    控制总线 数据总线和地址总线是三根线吗
    单元格中间没有边框
    页面上插入bootstrap Glyphicons时遇到的问题
    浏览器回退键——重复提交
    【excel】excel转成csv乱码问题
  • 原文地址:https://www.cnblogs.com/GYoungBean/p/3852706.html
Copyright © 2020-2023  润新知