JDBC本质就是sun公司开发的一套用来操作所有关系型数据库的接口,目的就是使用Java语言操作关系型数据库,我们使用的实现类的jar包是由数据库厂商提供
JDBC的使用流程
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
//jdbc的使用过程
public class JDBCdemo1 {
    public static void main(String[] args) throws Exception {
        //1.导入jar包
        //2.注册驱动
        Class.forName("com.mysql.jdbc.Driver");
        //3.获取数据库连接对象
        Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/db1", "root", "root");
        //4.定义sql语句
        String sql = "update student set age = 21 where name = ‘孙策‘";
        //5.获取执行sql的对象
        Statement statement = connection.createStatement();
        //6.执行sql语句
        statement.executeUpdate(sql);
        //7.处理返回值....
        //8.释放资源
        statement.close();
        connection.close();
    }
}
原文:https://www.cnblogs.com/codegzy/p/14730003.html