public static HookConfig fromDb(String jdbcConn) {
        if (!dbInitialized)
            throw new RuntimeException("HookConfig: Could not load postgresql driver, using default configuration.");
        try {
            Connection conn = DriverManager.getConnection(jdbcConn);
            Statement st = conn.createStatement();
            ResultSet rs = st.executeQuery("SELECT * FROM hookconfig");
            try {
                if (rs.next())
                    return new HookConfig(rs.getString(1), rs.getInt(2), rs.getString(3), Method.valueOf(rs.getString(4)));
                else
                    return null;
            } finally {
                rs.close();
                st.close();
                conn.close();
            }
        } catch (SQLException e) {
            throw new RuntimeException("Could not read hook config from database.", e);
        }
    }