Skip to content

Commit 902f5ea

Browse files
add isConnectionClosed method
1 parent b8c1ab5 commit 902f5ea

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

sqldev/src/main/java/org/utplsql/sqldev/model/DatabaseTools.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,12 @@ public static Connection getConnection(String connectionName) {
5858
throw new GenericDatabaseAccessException(msg, e);
5959
}
6060
}
61+
62+
public static boolean isConnectionClosed(Connection conn) {
63+
try {
64+
return conn.isClosed();
65+
} catch (SQLException e) {
66+
throw new GenericDatabaseAccessException("Error getting status of connection.", e);
67+
}
68+
}
6169
}

0 commit comments

Comments
 (0)