java/sql-dk/src/info/globalcode/sql/dk/DatabaseConnection.java
branchv_0
changeset 65 f05be87239ad
parent 55 f5ed7c4efacc
child 86 6b0eb3b22eb8
--- a/java/sql-dk/src/info/globalcode/sql/dk/DatabaseConnection.java	Thu Dec 26 01:05:24 2013 +0100
+++ b/java/sql-dk/src/info/globalcode/sql/dk/DatabaseConnection.java	Thu Dec 26 01:24:21 2013 +0100
@@ -120,6 +120,17 @@
 
 	}
 
+	/**
+	 * Tests if this connection is live.
+	 *
+	 * @return true if test was successful
+	 * @throws SQLException if test fails
+	 */
+	public boolean test() throws SQLException {
+		connection.getAutoCommit();
+		return true;
+	}
+
 	@Override
 	public void close() throws SQLException {
 		connection.close();