Permalink
Browse files

insert new time a different way

  • Loading branch information...
1 parent 5a1826b commit b5c5c20f57ec932f1a1ecbc1a8d98a389eac0dc6 BuzzTroll committed Oct 16, 2010
Showing with 4 additions and 4 deletions.
  1. +4 −4 authzdb/src/org/nimbus/authz/AuthzDBAdapter.java
@@ -25,7 +25,7 @@
private static final String GET_DATA_KEY = "select data_key from objects where id = ?";
private static final String CREATE_NEW_FILE = "insert into objects (name, owner_id, data_key, object_type, parent_id, creation_time) values(?, ?, ?, ?, ?, datetime('now'))";
private static final String SET_NEW_FILE_PERMS = "insert into object_acl (user_id, object_id, access_type_id) values(?, ?, ?)";
- private static final String UPDATE_FILE_INFO = "update objects set object_size=?, creation_time=? where id = ?";
+ private static final String UPDATE_FILE_INFO = "update objects set object_size=?, creation_time=datetime('now') where id = ?";
private static final String GET_USER_USAGE = "SELECT SUM(object_size) FROM objects where owner_id = ? and object_type = ?";
private static final String GET_USER_QUOTA = "SELECT quota from object_quota where user_id = ? and object_type = ?";
private static final String GET_FILE_SIZE = "SELECT object_size FROM objects WHERE id = ?";
@@ -707,9 +707,9 @@ public void setFileSize(
c = getConnection();
pstmt = c.prepareStatement(UPDATE_FILE_INFO);
pstmt.setLong(1, size);
- long ms = new java.util.Date().getTime();
- pstmt.setDate(2, new Date(ms));
- pstmt.setInt(3, objectId);
+ //long ms = new java.util.Date().getTime();
+ //pstmt.setDate(2, new Date(ms));
+ pstmt.setInt(2, objectId);
int rc = pstmt.executeUpdate();
if(rc != 1)

0 comments on commit b5c5c20

Please sign in to comment.