summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/DataFiller.java25
1 files changed, 10 insertions, 15 deletions
diff --git a/src/main/DataFiller.java b/src/main/DataFiller.java
index 437fcdb..803d926 100644
--- a/src/main/DataFiller.java
+++ b/src/main/DataFiller.java
@@ -8,8 +8,6 @@ import java.sql.Connection;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
/**
* Process that incoming tweets and fill the database.
@@ -35,20 +33,17 @@ public class DataFiller {
* Create the datafiller object.
*
* @param connection The database connection to use.
+ * @throws java.sql.SQLException on error preparing the database connection.
*/
- public DataFiller(Connection connection) {
- try {
- m_connection = connection;
- m_insertTweet = new NamedPreparedStatement(m_connection, QueryUtils.insertTweet);
- m_insertProfile = new NamedPreparedStatement(m_connection, QueryUtils.insertProfile);
- m_insertBrand = new NamedPreparedStatement(m_connection, QueryUtils.insertBrand);
- m_insertHash = new NamedPreparedStatement(m_connection, QueryUtils.insertHash);
- m_insertTweetUrl = new NamedPreparedStatement(m_connection, QueryUtils.insertTweetUrl);
- m_insertUserUrl = new NamedPreparedStatement(m_connection, QueryUtils.insertUserUrl);
- m_insertMentions = new NamedPreparedStatement(m_connection, QueryUtils.insertMentions);
- } catch (SQLException ex) {
- throw new RuntimeException(ex.getMessage());
- }
+ public DataFiller(Connection connection) throws SQLException {
+ m_connection = connection;
+ m_insertTweet = new NamedPreparedStatement(m_connection, QueryUtils.insertTweet);
+ m_insertProfile = new NamedPreparedStatement(m_connection, QueryUtils.insertProfile);
+ m_insertBrand = new NamedPreparedStatement(m_connection, QueryUtils.insertBrand);
+ m_insertHash = new NamedPreparedStatement(m_connection, QueryUtils.insertHash);
+ m_insertTweetUrl = new NamedPreparedStatement(m_connection, QueryUtils.insertTweetUrl);
+ m_insertUserUrl = new NamedPreparedStatement(m_connection, QueryUtils.insertUserUrl);
+ m_insertMentions = new NamedPreparedStatement(m_connection, QueryUtils.insertMentions);
}
/**