code cleaning, new config
[mir.git] / source / mircoders / storage / DatabaseLinksImcs.java
index e2d55f5..b69a0cf 100755 (executable)
 \r
 package  mircoders.storage;\r
 \r
-import  java.lang.*;\r
-import  java.sql.*;\r
-import  java.io.*;\r
-import  java.util.*;\r
-import  freemarker.template.*;\r
-import  mir.storage.*;\r
-import  mir.entity.*;\r
-import  mir.misc.*;\r
-import  mir.util.*;\r
+import java.sql.Connection;\r
+import java.sql.PreparedStatement;\r
+import java.sql.ResultSet;\r
+import java.sql.SQLException;\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+\r
+import mir.entity.Entity;\r
+import mir.storage.Database;\r
+import mir.storage.StorageObject;\r
+import mir.storage.StorageObjectFailure;\r
+import mir.util.JDBCStringRoutines;\r
 \r
 \r
 /**\r
@@ -60,7 +63,7 @@ public class DatabaseLinksImcs extends Database
   // could get preemted and we could end up with 2 instances of DatabaseFoo..\r
   // see the "Singletons with needles and thread" article at JavaWorld -mh\r
   public synchronized static DatabaseLinksImcs getInstance() throws\r
-      StorageObjectException {\r
+      StorageObjectFailure {\r
     if (instance == null) {\r
       instance = new DatabaseLinksImcs();\r
       instance.myselfDatabase = instance;\r
@@ -71,7 +74,7 @@ public class DatabaseLinksImcs extends Database
   /**\r
    * put your documentation comment here\r
    */\r
-  private DatabaseLinksImcs() throws StorageObjectException {\r
+  private DatabaseLinksImcs() throws StorageObjectFailure {\r
     super();\r
     ////this.cache = new HashMap();\r
     this.hasTimestamp = false;\r
@@ -80,13 +83,13 @@ public class DatabaseLinksImcs extends Database
       this.theEntityClass = Class.forName("mircoders.entity.EntityLinksImcs");\r
     }\r
     catch (Exception e) {\r
-      throw new StorageObjectException(e.toString());\r
+      throw new StorageObjectFailure(e);\r
     }\r
   }\r
 \r
   /** @todo toooo much copy/paste in this class //rk  */\r
 \r
-  public String insert(Entity theEntity) throws StorageObjectException {\r
+  public String insert(Entity theEntity) throws StorageObjectFailure {\r
     String returnId = "0";\r
     Connection con = null;\r
     PreparedStatement pstmt = null;\r
@@ -174,7 +177,7 @@ public class DatabaseLinksImcs extends Database
     return returnId;\r
   }\r
 \r
-  public void update(Entity theEntity) throws StorageObjectException {\r
+  public void update(Entity theEntity) throws StorageObjectFailure {\r
     Connection con = null;\r
     PreparedStatement pstmt = null;\r
     ArrayList streamedInput = theEntity.streamedInput();\r