coding style cleanup.
authormh <mh>
Fri, 8 Feb 2002 13:39:39 +0000 (13:39 +0000)
committermh <mh>
Fri, 8 Feb 2002 13:39:39 +0000 (13:39 +0000)
source/mir/storage/Database.java

index 6728e40..e46db2e 100755 (executable)
@@ -795,7 +795,9 @@ public class Database implements StorageObject {
     Connection con = null;
     Statement stmt = null;
     // build sql
-    StringBuffer sql = new StringBuffer("select ").append(thePKeyName).append(",").append(name).append(" from ").append(theTable);
+    StringBuffer sql = new StringBuffer("select ").append(thePKeyName)
+                                        .append(",").append(name).append(" from ")
+                                        .append(theTable);
     if (where != null && !(where.length() == 0))
       sql.append(" where ").append(where);
     sql.append(" order by ");
@@ -885,8 +887,8 @@ public class Database implements StorageObject {
     }
     catch (SQLException e)
     {
-      theLog.printDebugInfo("Failed: " + (new java.util.Date().getTime() - startTime) + "ms. for: "
-        + sql);
+      theLog.printDebugInfo("Failed: " + (new java.util.Date().getTime()
+                            - startTime) + "ms. for: "+ sql);
       throw e;
     }
 
@@ -900,8 +902,8 @@ public class Database implements StorageObject {
    * @return Liefert ResultSet des Statements zurueck.
    * @exception StorageObjectException, SQLException
    */
-  public ResultSet executeSql (PreparedStatement stmt) throws StorageObjectException,
-      SQLException {
+  public ResultSet executeSql (PreparedStatement stmt)
+    throws StorageObjectException, SQLException {
 
     long startTime = (new java.util.Date()).getTime();
     ResultSet rs = stmt.executeQuery();
@@ -935,7 +937,8 @@ public class Database implements StorageObject {
       freeConnection(con,stmt);
     }
     theLog.printInfo(theTable + " has "+ result +" rows where " + where);
-    theLog.printInfo((new java.util.Date().getTime() - startTime) + "ms. for: " + sql);
+    theLog.printInfo((new java.util.Date().getTime() - startTime) + "ms. for: "
+                    + sql);
     return result;
   }
 
@@ -947,12 +950,13 @@ public class Database implements StorageObject {
     try
     {
       rs = stmt.executeUpdate(sql);
-      theLog.printInfo((new java.util.Date().getTime() - startTime) + "ms. for: " + sql);
+      theLog.printInfo((new java.util.Date().getTime() - startTime) + "ms. for: "
+                        + sql);
     }
     catch (SQLException e)
     {
-      theLog.printDebugInfo("Failed: " + (new java.util.Date().getTime() - startTime) + "ms. for: "
-        + sql);
+      theLog.printDebugInfo("Failed: " + (new java.util.Date().getTime() 
+                            - startTime) + "ms. for: "+ sql);
       throw e;
     }
     return rs;
@@ -974,7 +978,8 @@ public class Database implements StorageObject {
       throw new StorageObjectException("executeUpdate failed: "+e.toString());
     }
     finally { freeConnection(con,pstmt); }
-    theLog.printInfo((new java.util.Date().getTime() - startTime) + "ms. for: " + sql);
+    theLog.printInfo((new java.util.Date().getTime() - startTime) + "ms. for: "
+                    + sql);
     return result;
   }
 
@@ -983,7 +988,9 @@ public class Database implements StorageObject {
    * @param md ResultSetMetaData
    * @exception StorageObjectException
    */
-  private void evalMetaData (ResultSetMetaData md) throws StorageObjectException {
+  private void evalMetaData (ResultSetMetaData md)
+    throws StorageObjectException {
+
     this.evaluatedMetaData = true;
     this.metadataFields = new ArrayList();
     this.metadataLabels = new ArrayList();
@@ -1035,11 +1042,12 @@ public class Database implements StorageObject {
 
   
   public Connection getPooledCon() throws StorageObjectException {
-    try{
+    /*try{
       Class.forName("com.codestudio.sql.PoolMan").newInstance();
     } catch (Exception e){
-      throw new StorageObjectException("Could not find the PoolMan Driver"+e.toString());
-    }
+      throw new StorageObjectException("Could not find the PoolMan Driver"
+                                        +e.toString());
+    }*/
     Connection con = null;
     try{
       con = SQLManager.getInstance().requestConnection();
@@ -1061,7 +1069,8 @@ public class Database implements StorageObject {
    * @param wo Funktonsname, in der die SQLException geworfen wurde
    * @exception StorageObjectException
    */
-  protected void throwSQLException (SQLException sqe, String wo) throws StorageObjectException {
+  protected void throwSQLException (SQLException sqe, String wo)
+    throws StorageObjectException {
     String state = "";
     String message = "";
     int vendor = 0;
@@ -1076,7 +1085,8 @@ public class Database implements StorageObject {
         sqe.toString());
   }
 
-  protected void _throwStorageObjectException (Exception e, String wo) throws StorageObjectException {
+  protected void _throwStorageObjectException (Exception e, String wo)
+    throws StorageObjectException {
     if (e != null) {
         theLog.printError(e.toString()+ wo);
         throw  new StorageObjectException(wo + e.toString());
@@ -1088,11 +1098,13 @@ public class Database implements StorageObject {
   }
 
   /**
-   * Loggt Fehlermeldung mit dem Parameter Message und wirft dannach eine StorageObjectException
+   * Loggt Fehlermeldung mit dem Parameter Message und wirft dannach 
+   * eine StorageObjectException
    * @param message Nachricht mit dem Fehler
    * @exception StorageObjectException
    */
-  void throwStorageObjectException (String message) throws StorageObjectException {
+  void throwStorageObjectException (String message)
+    throws StorageObjectException {
     _throwStorageObjectException(null, message);
   }