diff options
author | Peter Wu <peter@lekensteyn.nl> | 2014-05-10 16:14:37 +0200 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2014-05-10 16:14:37 +0200 |
commit | c47ee5696665af5bdaf85e30fe3514009cde2a7c (patch) | |
tree | fc12ddf4f899739717c614a16793b676d5e6354a /src/database/NamedPreparedStatement.java | |
parent | 52eeb2d0fe0fb8ab841727fc1d464d871e1b0c6b (diff) | |
download | Datafiller-c47ee5696665af5bdaf85e30fe3514009cde2a7c.tar.gz |
Split url to tweetUrl and userUrl, misc fixes
* Insert User URLs.
* Fix hash insertion query (copy/paste error...).
* Split url to tweetUrl and userUrl as there is no "url" table anymore.
* Do not execute queries directly via getStmt(), but execute them via
NamedPreparedStatement such that faulty queries can be printed.
* Fix buildQuery for more than two primary keys.
* Drop comments from prepared statements members in DataFiller, there is
nothing that you cannot learn from the variable name. Besides there
was a copy/paste error for mentions.
* Change order of insertion to ensure consistency.
* Inline setting parameters for queries, it is now more transparant.
Diffstat (limited to 'src/database/NamedPreparedStatement.java')
-rw-r--r-- | src/database/NamedPreparedStatement.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/database/NamedPreparedStatement.java b/src/database/NamedPreparedStatement.java index 4c4485a..0569db7 100644 --- a/src/database/NamedPreparedStatement.java +++ b/src/database/NamedPreparedStatement.java @@ -66,4 +66,14 @@ public class NamedPreparedStatement { public PreparedStatement getStmt() { return stmt; } + + public void executeUpdate() throws SQLException { + try { + getStmt().executeUpdate(); + } catch (SQLException ex) { + System.err.println("Query error: " + ex.getMessage()); + System.err.println(stmt); + throw ex; + } + } } |