JDBC连接过程:1、导入驱动jar包 2、注册驱动 3、获取数据库连接对象 Connection conn = DriverManager.getConnection("URL","user","password")
4、定义sql语句 sql 5、获取执行sql对象 Statement stmt 6、执行sql stmt.executeUpdate(sql) 7、处理结果 输出 8、释放资源 stmt.close(); conn.close();