public void toDb(String jdbcConn) {
        if (!dbInitialized)
            throw new RuntimeException("HookConfig: Could not load postgresql driver, could not store in db.");
        try {

            Connection conn = DriverManager.getConnection(jdbcConn);
            Statement st = conn.createStatement();
            String query = String.format("insert into hookconfig values ('%s', %s, '%s', '%s')",
                getHostname(), getPort(), getUri(), getMethod().getName());
            st.execute(query);
            st.close();
            conn.close();
        } catch (SQLException e) {
            throw new RuntimeException("Could not write hook config to database.", e);
        }
    }