public void addLogs(ArrayList<WorkLog> logs, boolean testMode) throws ClassNotFoundException, SQLException, Exception {
        String insertString =
                "INSERT INTO task_log "
                + "(task_log_task, task_log_description, task_log_creator, task_log_hours, task_log_date, task_log_name)"
                + "VALUES (?, ?, ?, ?, ?, ?)";

        PreparedStatement insertLog = null;

        try {
            conn.setAutoCommit(false);
            insertLog = conn.prepareStatement(insertString);

            for (WorkLog log : logs) {
                if (log.getDotProjectTaskId() != null) {
                    if (isDynamicTask(log.getDotProjectTaskId())) {
                        Logger.getLogger(
                                DotProjectClient.class.getName()).log(
                                Level.WARNING, "The task {0} is dynamic and its logs won''t be imported.", log.getDotProjectTaskId());
                    } else {
                        insertLog.setInt(1, log.getDotProjectTaskId());
                        insertLog.setString(2, new String(log.getWorkDescription().getBytes("UTF-8"), Charset.forName(encoding)));
                        insertLog.setInt(3, this.getUserId(log.getUsername()));
                        insertLog.setFloat(4, log.getHours().floatValue());
                        insertLog.setDate(5, new Date(log.getWorkDate().getTime()));
                        insertLog.setString(6, new String(log.getIssueKey().getBytes("UTF-8"), Charset.forName(encoding)));
                        if (testMode == false) {
                            insertLog.executeUpdate();
                        }
                    }
                }
            }
            conn.commit();
        } catch (Exception ex) {
            Logger.getLogger(DotProjectClient.class.getName()).log(Level.SEVERE, "Error during the DotProject import!", ex);
            if (conn != null) {
                try {
                    Logger.getLogger(DotProjectClient.class.getName()).log(Level.INFO, "The transction is being rolled back!");
                    conn.rollback();
                } catch (SQLException excep) {
                    Logger.getLogger(DotProjectClient.class.getName()).log(Level.SEVERE, "The transction can't be rolled back!", excep);
                }
            }
            throw ex;
        } finally {
            if (insertLog != null) {
                insertLog.close();
            }
        }

    }