JDBC , namely Java Database Connectivity, java database connection. It is a Java API for executing SQL statements. It is a database connection specification in Java. This API is composed of some classes and interfaces in the java.sql. and javax.sql. packages. It provides a standard API for Java developers to manipulate databases, and can provide unified access to a variety of relational databases.
1. JDBC working principle
JDBC access database hierarchy:
JDBC advantage
Java language access to database operations is completely oriented to abstract interface programming;
The development of database applications is not limited to the API of a specific database vendor;
The portability of the program is greatly enhanced;
2. Use of JDBC
JDBC use steps
Create a database connection Connection;
Create Operation Command Statement;
Use operation commands to execute SQL;
Processing result set ResultSet;
Release resources;
2.1 Establish a database connection
The URL parameter format of MySQL data connection is as follows: jdbc:mysql://server address:port/database name? parameter name=parameter value