dbutils.java
来自「这是一本描述JDBC数据库的书籍」· Java 代码 · 共 57 行
JAVA
57 行
/* * DBUtils.java * * Created on June 9, 2005, 2:51 PM * * To change this template, choose Tools | Options and locate the template under * the Source Creation and Management node. Right-click the template and choose * Open. You can then make changes to the template in the Source Editor. */package common;import java.sql.*;/** * * @author kevin */public final class DBUtils { /** Creates a new instance of DBUtils */ public DBUtils() { } public static void close(ResultSet rs, Statement stmt, Connection conn){ try{ if(rs != null)rs.close(); if(stmt != null)stmt.close(); if(conn != null)conn.close(); }catch(SQLException e){} } public static void close(ResultSet rs, Statement stmt){ close(rs, stmt, null); } public static void close(ResultSet rs){ close(rs, null); } public static void close(Statement stmt, Connection conn){ close(null, stmt, conn); } public static void close(Statement stmt){ close(null, stmt, null); } }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?