diff --git a/projects/samskivert/src/java/com/samskivert/jdbc/JDBCUtil.java b/projects/samskivert/src/java/com/samskivert/jdbc/JDBCUtil.java new file mode 100644 index 00000000..cc6163b3 --- /dev/null +++ b/projects/samskivert/src/java/com/samskivert/jdbc/JDBCUtil.java @@ -0,0 +1,36 @@ +// +// $Id: JDBCUtil.java,v 1.1 2000/12/06 00:27:30 mdb Exp $ + +package com.samskivert.jdbc; + +import java.sql.*; + +/** + * A repository for JDBC related utility functions. + */ +public class JDBCUtil +{ + /** + * Closes the supplied JDBC statement and gracefully handles being + * passed null (by doing nothing). + */ + public static void close (Statement stmt) + throws SQLException + { + if (stmt != null) { + stmt.close(); + } + } + + /** + * Closes the supplied JDBC connection and gracefully handles being + * passed null (by doing nothing). + */ + public static void close (Connection conn) + throws SQLException + { + if (conn != null) { + conn.close(); + } + } +} diff --git a/projects/samskivert/src/java/com/samskivert/jdbc/Makefile b/projects/samskivert/src/java/com/samskivert/jdbc/Makefile new file mode 100644 index 00000000..f87205ae --- /dev/null +++ b/projects/samskivert/src/java/com/samskivert/jdbc/Makefile @@ -0,0 +1,9 @@ +# +# $Id: Makefile,v 1.1 2000/12/06 00:27:30 mdb Exp $ + +ROOT = ../../.. + +SRCS = \ + JDBCUtil.java \ + +include $(ROOT)/build/Makefile.java