media handling fixes, gotten rid of StorageObject, set the default method for blots...
[mir.git] / source / mircoders / storage / DatabaseComment.java
index 98e8f8e..ab545b6 100755 (executable)
@@ -36,7 +36,7 @@ import java.sql.Statement;
 
 import mir.log.LoggerWrapper;
 import mir.storage.Database;
-import mir.storage.StorageObject;
+import mir.storage.Database;
 import mir.storage.StorageObjectFailure;
 
 /**
@@ -46,7 +46,7 @@ import mir.storage.StorageObjectFailure;
  *
  */
 
-public class DatabaseComment extends Database implements StorageObject{
+public class DatabaseComment extends Database {
 
   private static DatabaseComment instance;
 
@@ -59,27 +59,25 @@ public class DatabaseComment extends Database implements StorageObject{
 
   private DatabaseComment() {
     super();
-    hasTimestamp = false;
     mainTable = "comment";
     logger = new LoggerWrapper("Database.Comment");
 
-    this.theEntityClass = mircoders.entity.EntityComment.class;
+    entityClass = mircoders.entity.EntityComment.class;
   }
 
   public boolean deleteByContentId(String id) throws StorageObjectFailure {
     Statement stmt = null;
     Connection con = null;
     String sql;
-    int res = 0;
 
-    /** @todo comments and topics should be deleted */
+    /** todo comments and topics should be deleted */
     sql = "delete from " + mainTable + " where to_media=" + id;
     logger.info("DELETE "+ sql);
 
     try {
-      con = getPooledCon();
+      con = obtainConnection();
       stmt = con.createStatement();
-      res = stmt.executeUpdate(sql);
+      stmt.executeUpdate(sql);
     }
     catch (SQLException sqe) {
       new StorageObjectFailure(sqe);