随笔分类 -  jdbc

摘要:package java4.exer; import java.sql.Connection; import java.sql.PreparedStatement; import java.util.Scanner; import org.junit.Test; import java3.util. 阅读全文
posted @ 2022-04-18 23:49 ice--cream 编辑
摘要:package java3.crud; import java.io.IOException; import java.io.InputStream; import java.sql.Connection; import java.sql.DriverManager; import java.sql 阅读全文
posted @ 2022-04-18 19:10 ice--cream 编辑
摘要:package connection; import java.io.IOException; import java.io.InputStream; import java.sql.Connection; import java.sql.Driver; import java.sql.Driver 阅读全文
posted @ 2022-04-18 09:52 ice--cream 编辑
摘要:PreparedStatement针对不同表的通用查询操作 public class PreparedStatementQueryTest { @Test public void testGetForList(){ String sql="select id,name,email from cust 阅读全文
posted @ 2021-06-23 13:41 ice--cream 编辑
摘要: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 编辑
摘要:封装数据库连接和关闭操作 @Test public void testUpdate() throws Exception{ //1、获取数据库连接 Connection conn= JDBCUtils.getConnection(); // 2、预编译sql语句,返回PreparedStatemen 阅读全文
posted @ 2021-06-22 10:49 ice--cream 编辑
摘要: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 编辑
摘要:package com.lwb.connection; import org.junit.jupiter.api.Test; import java.io.InputStream; import java.sql.Connection; import java.sql.Driver; import 阅读全文
posted @ 2021-06-21 22:24 ice--cream 编辑

点击右上角即可分享
微信分享提示