import java.io.IOException;
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.Statement;
public class CommonUtil {
private static final String OS = getOS();
try {
if (obj instanceof Closeable) {
((Closeable) obj).close();
- } else if (obj instanceof AutoCloseable) {
- ((AutoCloseable) obj).close();
+ } else if (obj instanceof ResultSet) {
+ ((ResultSet) obj).close();
+ } else if (obj instanceof Statement) {
+ ((Statement) obj).close();
+ } else if (obj instanceof Connection) {
+ ((Connection) obj).close();
} else {
Logger.error("Object is not closable");
}