无框架的JDBC连接池,主要方法有: 查询语句:executeQuery(String sql) 查询语句:executeQuery(String sql,Object[] params) 执行语句:executeUpdate(String sql) 执行语句:executeUpdate(String sql,Object[] params) :smile: 文件下载地址: - [JDBCUtil.zip](https://www.mclansky.com/usr/uploads/2021/06/355461520.zip) 部分代码预览: ```java package JQuery.util; /**使用PreparedStatement使Statement更加安全**/ import java.sql.PreparedStatement; import java.sql.DriverManager; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.ResultSetMetaData; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; public class JDBCUtil { /**数据库链接必要属性:类型、地址、端口、用户名、密码、库名**/ private static String sql; private static String address; private static String port; private static String username; private static String password; private static String dbname; /**创建唯一属性保存最总url地址**/ private static String url; /**JDBC操作数据库所需对象**/ private static Connection connection=null; //链接对象 private static PreparedStatement stmt=null; //操作数据库的对象 private static ResultSet rs=null; //结果保存对象 /**自身对象确保唯一**/ private static JDBCUtil jdbcUtil= null; private static boolean errSwitch = true; //是否提示错误信息 private static boolean infoSwitch = true; ``` Last modification:September 3, 2021 © Allow specification reprint Support Appreciate the author AliPayWeChat Like If you think my article is useful to you, please feel free to appreciate