一、创建普通项目
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210525080930146.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2NzbnoxMjMxMjM=,size_16,color_FFFFFF,t_70)
二、创建lib包导入驱动
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210525080951552.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2NzbnoxMjMxMjM=,size_16,color_FFFFFF,t_70)
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210525081107470.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2NzbnoxMjMxMjM=,size_16,color_FFFFFF,t_70)
三、添加jar包到lib仓库
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210525081124844.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2NzbnoxMjMxMjM=,size_16,color_FFFFFF,t_70)
四、编写测试代码
//1.注册驱动
Class.forName("com.mysql.jdbc.Driver");
//2.获取连接
String url = "jdbc:mysql://127.0.0.1:3306/brrbaii";
String username = "root";
String password = "123456";
Connection connect = DriverManager.getConnection(url,username,password);
//3.定义SQL
String sql = "update account set money = 2000 where id = 2";
//4.获取执行sql对象statement
Statement stmt = connect.createStatement();
//5.执行sql--count为影响行数
int count = stmt.executeUpdate(sql);
//6.处理结果过
System.out.println(count);
//7.释放资源
stmt.close();
connect.close();