From a8bebb13f13e29e33ba0ca72c5617d1e8527e4a9 Mon Sep 17 00:00:00 2001 From: rk Date: Wed, 6 Feb 2002 15:57:41 +0000 Subject: [PATCH] count optimizaton moved --- source/mir/storage/Database.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/source/mir/storage/Database.java b/source/mir/storage/Database.java index 575d3743..26e35c26 100755 --- a/source/mir/storage/Database.java +++ b/source/mir/storage/Database.java @@ -433,14 +433,16 @@ public class Database implements StorageObject { if (rs.next()) count = rs.getInt(1); rs.close(); + //nothing in the table: return null + if(count<=0){ + freeConnection(con, stmt); + return null; + } } else { - theLog.printError("Mh. Konnte nicht zaehlen: " + countSql); + theLog.printError("Could not count: " + countSql); } } - //nothing in the table: return null - if(count<=0){ - return null; - } + // hier select rs = executeSql(stmt, selectSql.toString()); if (rs != null) { @@ -1123,7 +1125,7 @@ public class Database implements StorageObject { void throwStorageObjectException (String message) throws StorageObjectException { _throwStorageObjectException(null, message); } - + } -- 2.11.0