随笔分类 - JDBC
摘要:Mybatis中的CRUD Mybatis工具类 public class MybatisUtils { private static SqlSessionFactory sqlSessionFactory; static { try { // 从配置文件获取SqlSessionFactory St
阅读全文
摘要:DBUtils的使用 QueryRunner的插入使用 @Test public void testInsert() throws Exception { QueryRunner queryRunner = new QueryRunner(); String insert = "insert int
阅读全文
摘要:Druid线程池创建Connection 代码实现 public class DruidTest { public static void main(String[] args) throws Exception { new DruidTest().getConnection(); } public
阅读全文
摘要:java批处理sql 需要5.1.37及之后的驱动jar包 需要rewriteBatchedStatements=true import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedState
阅读全文
摘要:JDBC的各种连接方式 终极版 // 最终版 // 将配置写在配置文件中,用流读取 @Test public void finalTestConnection() throws Exception { // 读取配置文件 Properties properties = new Properties(
阅读全文

浙公网安备 33010602011771号