commit a98f44ed5ae0f65534b007e0df45301f169fa765
Author: Tomáš Šimandl <tomas.simandl@gmail.com>
Date:   Thu Aug 30 17:24:53 2018 +0200

    Removed TABLE 'log' from database

diff --git a/sources/create_table.sql b/sources/create_table.sql
index 7983186..5ec9f11 100644
--- a/sources/create_table.sql
+++ b/sources/create_table.sql
@@ -38,24 +38,6 @@ CREATE TABLE IF NOT EXISTS `diagram` (
 
 -- --------------------------------------------------------
 
---
--- Struktura tabulky `log`
---
-
-CREATE TABLE IF NOT EXISTS `log` (
-  `id` int(11) NOT NULL,
-  `id_user` int(11) NOT NULL,
-  `user_name` varchar(10) COLLATE utf8_czech_ci NOT NULL,
-  `id_diagram` int(11) NOT NULL,
-  `event` varchar(10) COLLATE utf8_czech_ci NOT NULL,
-  `date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
-  `date_delay` datetime DEFAULT NULL,
-  `change_jar` varchar(128) COLLATE utf8_czech_ci DEFAULT NULL,
-  `new_version` varchar(128) COLLATE utf8_czech_ci DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
-
--- --------------------------------------------------------
-
 --
 -- Struktura tabulky `user`
 --
@@ -82,12 +64,6 @@ CREATE TABLE IF NOT EXISTS `user` (
 ALTER TABLE `diagram`
   ADD PRIMARY KEY (`id`);
 
---
--- Klíče pro tabulku `log`
---
-ALTER TABLE `log`
-  ADD PRIMARY KEY (`id`);
-
 --
 -- Klíče pro tabulku `user`
 --
@@ -104,11 +80,6 @@ ALTER TABLE `user`
 ALTER TABLE `diagram`
   MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;
 --
--- AUTO_INCREMENT pro tabulku `log`
---
-ALTER TABLE `log`
-  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
---
 -- AUTO_INCREMENT pro tabulku `user`
 --
 ALTER TABLE `user`
diff --git a/sources/src/main/java/cz/zcu/kiv/offscreen/user/Log.java b/sources/src/main/java/cz/zcu/kiv/offscreen/user/Log.java
deleted file mode 100644
index 73c92a0..0000000
--- a/sources/src/main/java/cz/zcu/kiv/offscreen/user/Log.java
+++ /dev/null
@@ -1,121 +0,0 @@
-package cz.zcu.kiv.offscreen.user;
-
-import com.mysql.jdbc.PreparedStatement;
-import java.sql.Connection;
-import java.sql.Date;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.text.SimpleDateFormat;
-import java.util.*;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.servlet.ServletContext;
-
-/**
- * Class is usefull for saving and loading diagram params from database.
- *
- * @author Daniel Bureš
- *
- */
-public class Log {
-    private DB db = null;
-    private int id = 0;
-    private ResultSet rs;
-
-
-    public Log(DB db) {
-        this(db, 0);
-    }
-
-
-    public Log(DB db, int id) {
-        this.db = db;
-        this.id = id;
-    }
-
-    /**
-     * Method returns object id.
-     *
-     * @return id
-     */
-    public int getId() {
-        return this.id;
-    }
-
-    /**
-     * Method returns id of object as string.
-     *
-     * @return
-     */
-    public String getIdStr() {
-        return Integer.toString(this.id);
-    }
-
-
-    public int createLog(Map<String, String> param) {
-        String idUser = param.get("user_id");
-        String idDiagram = param.get("id_diagram");
-        String event = param.get("log_event");
-        String delay = param.get("log_date_delay");
-        String jar = param.get("change_jar");
-        String userName = param.get("user_name");
-        String newVersion = param.get("new_version");
-        Connection con = db.getConn();
-        PreparedStatement pstmt;
-        try {
-            pstmt = (PreparedStatement) con.prepareStatement("INSERT INTO log(id_user,user_name,id_diagram,event,date,date_delay,change_jar,new_version) VALUES "+
-                    "(?,?,?,?,?,?,?,?)");
-            pstmt.setInt(1,Integer.parseInt(idUser));
-            pstmt.setString(2,userName);
-            pstmt.setInt(3,Integer.parseInt(idDiagram));
-            pstmt.setString(4,event);
-            Date date2 = new Date(System.currentTimeMillis());
-            pstmt.setDate(5,date2);
-            Date date=null;
-            if(delay!=null){
-               date = new Date(Integer.parseInt(delay));
-            }
-            pstmt.setDate(6,date);
-            pstmt.setString(7,jar);
-            pstmt.setString(8,newVersion);
-            return pstmt.executeUpdate();
-        } catch (SQLException ex) {
-            Logger.getLogger(Log.class.getName()).log(Level.SEVERE, null, ex);
-            return -1;
-        }
-
-            
-//        return db.exStatement(qy);
-    }
-    public List<Map<String,String>> readLogs(int idDiagram){
-        List<Map<String,String>> diagram_list = new ArrayList<Map<String,String>>();
-        String qy = "SELECT * FROM log WHERE id_diagram = '"+idDiagram+"' ORDER BY date ASC ";
-        try {
-            rs = db.exQuery(qy);
-            while ( rs != null && rs.next() ) {
-                HashMap<String, String> item_map = new HashMap<String, String>();
-                item_map.put("id", String.valueOf(rs.getInt("id")));
-                item_map.put("user_id", String.valueOf(rs.getInt("id_user")));
-                item_map.put("user_name", String.valueOf(rs.getString("user_name")) );
-                item_map.put("diagram_id", String.valueOf(rs.getInt("id_diagram")) );
-                item_map.put("log_date", Util.formatDate(rs.getString("date")) );
-                item_map.put("log_event", String.valueOf(rs.getString("event")) );
-                String str = String.valueOf(rs.getString("date_delay"));
-                if(str!=null) str = Util.formatDate(str);
-                item_map.put("log_date_delay", str);
-                item_map.put("change_jar", rs.getString("change_jar"));
-                item_map.put("new_version", String.valueOf(rs.getString("new_version") ) );
-                diagram_list.add(item_map);
-            }
-
-        } catch (SQLException e) {
-
-            e.printStackTrace();
-        }
-
-        return diagram_list;
-
-    }
-}
