- Pentaho 5.0 Reporting by Example
- Mariano García Mattío Dario R. Bernabeu
- 293字
- 2021-08-13 16:24:37
Learning about JDBC driver
Java Database Connectivity (JDBC) is an Application Programming Interface (API), which defines how a client should access and interact with a database from Java. Each provider (IBM, Oracle, Sun, Microsoft, and others) implements the mechanism (the "How To") for its own product, allowing the client not to be bothered with the details of each implementation and worrying only about its interface. In Java slang, this is known merely as a controller or JDBC driver.
Note
A JDBC driver, generally speaking, consists of one or various files with a .jar
extension, which must be copied on a certain path (Java CLASSPATH
, that is) so that applications can make use of it instead.
In order for a JDBC driver to be used, Java programs require the following information:
- URL: This is a string that specifies, among other things, the protocol, location of the server, port, and name of the database.
- Driver: This is the name of the class that implements the
java.sql.Driver
interface. - User: This is the user with the necessary privileges on the database engine (this parameter might be optional depending on the case).
- Password: This is the password corresponding to the user (this parameter might also be optional).
In some cases, the inclusion of the user and password is supported within the URL, so we only need to define the URL and Driver parameters.
The syntax to indicate the URL and driver class name should always be present in the implementation documentation of each provider.
For example, in the case of MySQL, the information regarding the implementation can be found in the following web page:
http://dev.mysql.com/downloads/connector/j/5.1.html
The implementation details are as follows:
- Driver:
com.mysql.jdbc.Driver
- URL:
jdbc:mysql://localhost:3306/MyDataBase
- Protocol:
jdbc:mysql
- Name server:
localhost (local address)
- Port:
3306 (default port)
- Database:
MyDataBase
- Word/Excel/PowerPoint 2013三合一高效辦公超級手冊
- 中文版Rhino 5.0實用教程
- Word/Excel/PPT 2007辦公技巧
- Office 2019高效辦公三合一從入門到精通(視頻自學版)
- Excel財務會計應用
- Excel 2019公式、函數應用大全
- Excel大神是怎么做表的
- Excel 2016辦公專家從入門到精通(視頻自學版)
- PPT制作應用大全2019
- Excel數據透視表應用之道(雙色板)
- Office 2016辦公應用實戰從入門到精通(超值版)
- 如何高效辦公:Word2013經典應用技巧大全
- 人事管理政務網上公開的發展與對策
- PowerShell for Office 365應用實戰
- Office 2007案例教程