empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doeb...@apache.org
Subject svn commit: r1361189 - /empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBDatabase.java
Date Fri, 13 Jul 2012 13:00:25 GMT
Author: doebele
Date: Fri Jul 13 13:00:25 2012
New Revision: 1361189

URL: http://svn.apache.org/viewvc?rev=1361189&view=rev
Log:
EMPIREDB-141
again small code and javadoc adjustments to the quer??? overloads in DBDatabase

Modified:
    empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBDatabase.java

Modified: empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBDatabase.java
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBDatabase.java?rev=1361189&r1=1361188&r2=1361189&view=diff
==============================================================================
--- empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBDatabase.java (original)
+++ empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBDatabase.java Fri Jul 13
13:00:25 2012
@@ -1196,14 +1196,13 @@ public abstract class DBDatabase extends
     public final List<Object[]> queryObjectList(String sqlCmd, Connection conn)
     {   // Execute the  Statement
         List<Object[]> result = new ArrayList<Object[]>();
-        if (queryObjectList(sqlCmd, null, conn, result, -1)<0)
-            return null; // No result
+        queryObjectList(sqlCmd, null, conn, result, -1);
         return result;
     }
 
     /**
      * Returns all values of the first row of a sql-query as an array.
-     * If the query does not return a result null is returned
+     * If the query does not return a result a QueryNoResultException is thrown
      * 
      * @param sqlCmd the SQL-Command
      * @param sqlParams list of query parameter values
@@ -1214,13 +1213,15 @@ public abstract class DBDatabase extends
     public Object[] querySingleRow(String sqlCmd, Object[] sqlParams, Connection conn)
     {
         List<Object[]> result = new ArrayList<Object[]>();
-        if (queryObjectList(sqlCmd, sqlParams, conn, result, 1)<0 || result.size()<1)
-            return null; // No result
+        queryObjectList(sqlCmd, sqlParams, conn, result, 1);
+        if (result.size()<1)
+            throw new QueryNoResultException(sqlCmd);
         return result.get(0);
     }
     
     /**
      * Returns all values of the first row of a sql-query as an array.
+     * If the query does not return a result a QueryNoResultException is thrown
      * 
      * @param sqlCmd the SQL-Command
      * @param conn a valid connection to the database.



Mime
View raw message