5.1 Developer Guide
1. MysQL為由Java語言編程的客戶端程序提供連接:MySQL Connector/J,這是一個實現Java Database Connectivity(JDBC) API的驅動.
2.MySQL Connector/J 是一個JDBC Type 4驅動.類型4表示該驅動是純Java實現MySQL協議,並且不依賴MySQL客戶端庫.
3.對於大型程序that use common design patterns of data access,考慮使用流行的persistence框架,例如Hibernate,Spring's JDBC templates 或者MyBatis SQL Maps來減少debug,tune,secure和維護的JDBC代碼的數量.
4.Connector/J 5.1 是Type 4 pure Java JDBC driver,符合JDBC 3.0,4.0,4.1和4.2規范.
5.Installation
distributed as a .zip or .tar.gz archive.
The archive contains the sources and JAR archive named mysql-connector-java-version-bin.jar.
You can install the Connector/J package using either the binary or source distribution.
二進制的安裝最簡單.源distribution允許你深度定制你的安裝.
兩者都需要將Connector/J的位置添加到Java CLASSPATH中.
Connector/J也適用於Maven項目.
一. 解壓下載的文件.
二. 解壓后,可以通過將 mysql-connector-java-
version
-bin.jar放入classpath中,或者添加全路徑到CLASSPATH環境變量.
To use the driver with the JDBC DriverManager, use com.mysql.jdbc.Driver as the class that implements java.sql.Driver.