摘要: PreparedStatement实现通用的增删改操作 public void testCommonUpdate() throws Exception { String sql="update customers set name=? where id=?"; update(sql,"wtf",19 阅读全文
posted @ 2021-06-22 11:23 ice--cream 阅读(50) 评论(0) 推荐(0) 编辑
摘要: 封装数据库连接和关闭操作 @Test public void testUpdate() throws Exception{ //1、获取数据库连接 Connection conn= JDBCUtils.getConnection(); // 2、预编译sql语句,返回PreparedStatemen 阅读全文
posted @ 2021-06-22 10:49 ice--cream 阅读(102) 评论(0) 推荐(0) 编辑
摘要: PreparedStatement方法执行sql语句 package com.lwb.preparedstatement.crud; import org.junit.jupiter.api.Test; import java.io.InputStream; import java.sql.Conn 阅读全文
posted @ 2021-06-22 00:11 ice--cream 阅读(520) 评论(0) 推荐(0) 编辑