rebuilding head
[mir.git] / source / mircoders / storage / DatabaseComment.java
index 56f3e33..400b3fa 100755 (executable)
 
 package mircoders.storage;
 
-import java.sql.Connection;\r
-import java.sql.SQLException;\r
-import java.sql.Statement;\r
-\r
-import mir.log.LoggerWrapper;\r
-import mir.storage.Database;\r
-import mir.storage.StorageObject;\r
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+import mir.log.LoggerWrapper;
+import mir.storage.Database;
+import mir.storage.StorageObject;
 import mir.storage.StorageObjectFailure;
 
 /**
@@ -60,7 +60,7 @@ public class DatabaseComment extends Database implements StorageObject{
   private DatabaseComment() {
     super();
     hasTimestamp = false;
-    theTable = "comment";
+    mainTable = "comment";
     logger = new LoggerWrapper("Database.Comment");
 
     this.theEntityClass = mircoders.entity.EntityComment.class;
@@ -70,16 +70,15 @@ public class DatabaseComment extends Database implements StorageObject{
     Statement stmt = null;
     Connection con = null;
     String sql;
-    int res = 0;
 
-    /** @todo comments and topics should be deleted */
-    sql = "delete from " + theTable + " where to_media=" + id;
+    /** 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);