public void initializeDataBase(JList<String> log){
		ArrayList<String> alstLog = new ArrayList<>();
		try {
			Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
			String url = "jdbc:derby:" + DBName + ";create=true";
			alstLog.add("Connecting...");
			log.setListData(alstLog.toArray(new String[0]));
			Connection connection = DriverManager.getConnection(url);
			Statement statement = connection.createStatement();

			//			###CREATING TABLE USERS###
			
			alstLog.add("Creating Table users...");
			log.setListData(alstLog.toArray(new String[0]));
			
			String createUsers = "CREATE TABLE users ("
									+ "uid INTEGER NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY, "
									+ "Juser VARCHAR(24) NOT NULL,"
									+ "Jpassword VARCHAR(100) NOT NULL,"
									+ "Jnick VARCHAR(24),"
									+ "level INTEGER DEFAULT 1,"
									+ "currentExp INTEGER DEFAULT 0,"
									+ "rCoins INTEGER DEFAULT 0,"
									+ "vCoins INTEGER DEFAULT 0,"
									+ "points INTEGER DEFAULT 0,"
									+ "JlastLoggin TIMESTAMP DEFAULT CURRENT_TIMESTAMP)";
			statement.executeUpdate(createUsers);
			alstLog.add("Table users created");
			log.setListData(alstLog.toArray(new String[0]));
			
			// INSERT INTO USERS(JUSER, JPASSWORD) VALUES ('root', 'root')

			//			###CREATING TABLE USERUSERRELATIONSHIPTYPES###
			
			alstLog.add("Creating Table UserUserRelationshipTypes...");
			log.setListData(alstLog.toArray(new String[0]));
			
			String createUserUserRelationshipTypes = "CREATE TABLE UserUserRelationshipTypes ("
													+ "uurtid INTEGER NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY, "
													+ "rtype VARCHAR(255))";
			statement.executeUpdate(createUserUserRelationshipTypes);
			alstLog.add("Table UserUserRelationshipTypes created");
			log.setListData(alstLog.toArray(new String[0]));
			
			//			###FILLING TABLE USERUSERRELATIONSHIPTYPES###
			
			alstLog.add("Filling Table UserUserRelationshipTypes...");
			log.setListData(alstLog.toArray(new String[0]));
			
			String insertRelationshipTypeFriends = "INSERT INTO UserUserRelationshipTypes (rtype) VALUES ('friends')";
			statement.execute(insertRelationshipTypeFriends);
			
			String insertRelationshipTypeBlocked = "INSERT INTO UserUserRelationshipTypes (rtype) VALUES ('blocked')";
			statement.execute(insertRelationshipTypeBlocked);
			
			String insertRelationshipTypeRequested = "INSERT INTO UserUserRelationshipTypes (rtype) VALUES ('requested')";
			statement.execute(insertRelationshipTypeRequested);
			
			alstLog.add("Table UserUserRelationshipTypes filled");
			log.setListData(alstLog.toArray(new String[0]));
			
			//			###CREATING TABLE USERUSERRELATIONSHIPS###
			
			alstLog.add("Creating Table UserUserRelationships...");
			log.setListData(alstLog.toArray(new String[0]));
			
			String createUserUserRelationships = "CREATE TABLE UserUserRelationships ("
											+ "urID INTEGER NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY, "
											+ "initialUserID INTEGER REFERENCES USERS (uid),"
											+ "destinationUserID INTEGER REFERENCES USERS (uid),"
											+ "userUserRelationshipTypesID INTEGER REFERENCES USERUSERRELATIONSHIPTYPES (uurtid))";
			statement.executeUpdate(createUserUserRelationships);
			
			alstLog.add("Table UserUserRelationships created");
			log.setListData(alstLog.toArray(new String[0]));
			
			//			###CREATING TABLE CHATCHANNELTYPES###
			
			alstLog.add("Creating Table chatChannelTypes...");
			log.setListData(alstLog.toArray(new String[0]));
			
			String createChatChannelTypes = "CREATE TABLE chatChannelTypes("
											+ "cctID INTEGER NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY,"
											+ "cctype VARCHAR(255))";
			statement.executeUpdate(createChatChannelTypes);
			
			alstLog.add("Table chatChannelTypes created");
			log.setListData(alstLog.toArray(new String[0]));
			
			//			###FILLING TABLE CHATCHANNELTYPES###
			
			alstLog.add("Filling Table chatChannelTypes");
			log.setListData(alstLog.toArray(new String[0]));
			
			String insertChatChannelTypePrivate = "INSERT INTO CHATCHANNELTYPES (cctype) VALUES ('private')";
			statement.execute(insertChatChannelTypePrivate);
			
			String insertChatChannelTypePermanent = "INSERT INTO CHATCHANNELTYPES (cctype) VALUES ('permanent')";
			statement.execute(insertChatChannelTypePermanent);
			
			String insertChatChannelTypeCustom = "INSERT INTO CHATCHANNELTYPES (cctype) VALUES ('custom')";
			statement.execute(insertChatChannelTypeCustom);
			
			alstLog.add("Table chatChannelTypes filled");
			log.setListData(alstLog.toArray(new String[0]));
			
			//			###CREATING TABLE CHATCHANNELS###
			
			alstLog.add("Creating Table chatChannels...");
			log.setListData(alstLog.toArray(new String[0]));
			
			String createChatChannels = "CREATE TABLE chatChannels ("
										+ "channelID INTEGER NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY,"
										+ "channelType INTEGER REFERENCES CHATCHANNELTYPES(cctID),"
										+ "channelName VARCHAR(100))";
			statement.executeUpdate(createChatChannels);
			alstLog.add("Table chatChannels created");
			log.setListData(alstLog.toArray(new String[0]));
			
			// 			###FILLING TABLE CHATCHANNELS
			
			alstLog.add("Filling Table chatChannels...");
			log.setListData(alstLog.toArray(new String[0]));
			
			String insertChatChannelsHelp = "INSERT INTO CHATCHANNELS (channelType, channelName)" +
											"VALUES ((SELECT cctid FROM chatChannelTypes where cctype = 'permanent'), 'Help')";
			statement.executeUpdate(insertChatChannelsHelp);
			
			String insertChatChannelsJGame_DEU_1 = "INSERT INTO CHATCHANNELS (channelType, channelName)" +
													"VALUES ((SELECT cctid FROM chatChannelTypes where cctype = 'permanent'), 'JGame DEU-1')";
			statement.executeUpdate(insertChatChannelsJGame_DEU_1);
			
			alstLog.add("Table chatChannels filled");
			log.setListData(alstLog.toArray(new String[0]));
			
			//			###CREATING TABLE USERCHANNELRELATIONSHIPTYPES###

			alstLog.add("Creating Table userChannelRelationshiptypes...");
			log.setListData(alstLog.toArray(new String[0]));
			String createUserChannelRelationshiptypes = "CREATE TABLE userChannelRelationshiptypes ("
														+ "ucrtID INTEGER NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY, "
														+ "rtype VARCHAR(255))";
			statement.executeUpdate(createUserChannelRelationshiptypes);
			alstLog.add("Table userChannelRelationshiptypes created");
			log.setListData(alstLog.toArray(new String[0]));
			
			//			###FILLING TABLE USERCHANNELRELATIONSHIPTYPES###
			
			alstLog.add("Filling Table userChannelRelationshiptypes...");
			log.setListData(alstLog.toArray(new String[0]));
			
			String insertRelationshipTypeOnline = "INSERT INTO userChannelRelationshiptypes (rtype) VALUES ('online')";
			statement.execute(insertRelationshipTypeOnline);
			
			String insertRelationshipTypeOffline = "INSERT INTO userChannelRelationshiptypes (rtype) VALUES ('offline')";
			statement.execute(insertRelationshipTypeOffline);
			
			String insertRelationshipTypeMuted = "INSERT INTO userChannelRelationshiptypes (rtype) VALUES ('muted')";
			statement.execute(insertRelationshipTypeMuted);
			
			alstLog.add("Table userChannelRelationshiptypes filled");
			log.setListData(alstLog.toArray(new String[0]));
			
			//			###CREATING TABLE USERCHATRELATIONS###

			alstLog.add("Creating Table userChatRelations...");
			log.setListData(alstLog.toArray(new String[0]));
			String createUserChatRelations = "CREATE TABLE userChatRelations ("
												+ "ucrID INTEGER NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY, "
												+ "userID INTEGER REFERENCES USERS (uID),"
												+ "channelID INTEGER REFERENCES CHATCHANNELS (channelID),"
												+ "relationshipType INTEGER REFERENCES USERCHANNELRELATIONSHIPTYPES (ucrtID))";
			statement.executeUpdate(createUserChatRelations);
			alstLog.add("Table userChatRelations created");
			log.setListData(alstLog.toArray(new String[0]));
			
			//			###CREATING TABLE CHATMESSAGES###
			
			alstLog.add("Creating Table chatMessages...");
			log.setListData(alstLog.toArray(new String[0]));
			String createChatMessages = "CREATE TABLE chatmessages ("
										+ "messageid INTEGER NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY, "
										+ "user_uid INTEGER REFERENCES USERS (uid),"
										+ "channel_cid INTEGER REFERENCES CHATCHANNELS (channelID),"
										+ "message VARCHAR(100),"
										+ "messagedate TIMESTAMP)";
			statement.executeUpdate(createChatMessages);
			alstLog.add("Table chatMessages created");
			log.setListData(alstLog.toArray(new String[0]));
			
//			###CREATING TABLE PLAYMODES###
			
			alstLog.add("Creating Table playmodes...");
			log.setListData(alstLog.toArray(new String[0]));
			String createPlaymodes = "CREATE TABLE playmodes ("
										+ "pmid INTEGER NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY, "
										+ "titel VARCHAR(25),"
										+ "desctext VARCHAR(255),"
										+ "available boolean)";
			statement.executeUpdate(createPlaymodes);
			alstLog.add("Table playmodes created");
			log.setListData(alstLog.toArray(new String[0]));
			
			//			###FILLING TABLE PLAYMODES###
			
			alstLog.add("Filling Table playmodes...");
			log.setListData(alstLog.toArray(new String[0]));
			
			String insertPlaymodesFFA = "INSERT INTO playmodes (titel, desctext, available) VALUES ('FFA', 'Free for all - Up to 8 players fight against each other', true)";
			statement.execute(insertPlaymodesFFA);
			
			String insertPlaymodesTEAM = "INSERT INTO playmodes (titel, desctext, available) VALUES ('TEAM', 'Team vs Team - Two teams fight against each other', true)";
			statement.execute(insertPlaymodesTEAM);
			
			String insertPlaymodesUNDERDOG = "INSERT INTO playmodes (titel, desctext, available) VALUES ('UNDERDOG', 'The Underdog Challange - A single player competes against a group of player', true)";
			statement.execute(insertPlaymodesUNDERDOG);
			
			alstLog.add("Table playmodes filled");
			log.setListData(alstLog.toArray(new String[0]));
			
//			###CREATING TABLE PLAYMODETEAMS###
			
			alstLog.add("Creating Table playmodeTeams...");
			log.setListData(alstLog.toArray(new String[0]));
			String playmodeTeams = "CREATE TABLE playmodeteams ("
								+ "pmtID INTEGER NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY, "
								+ "pmID INTEGER REFERENCES PLAYMODES (pmID),"
								+ "size INTEGER)";
			statement.executeUpdate(playmodeTeams);
			alstLog.add("Table playmodeTeams created");
			log.setListData(alstLog.toArray(new String[0]));
			
//			###FILLING TABLE PLAYMODETEAMS###
			
			alstLog.add("Filling Table playmodeTeams...");
			log.setListData(alstLog.toArray(new String[0]));
			
			for (int i = 0; i < 8; i++) {
				String insertPlaymodeTeamsFFA = "INSERT INTO playmodeteams (pmid, size) VALUES ((SELECT pmid FROM playmodes WHERE titel = 'FFA'), 1)";
				statement.execute(insertPlaymodeTeamsFFA);
			}
			
			for (int i = 0; i < 2; i++) {
				String insertPlaymodeTeamsTEAM = "INSERT INTO playmodeteams (pmid, size) VALUES ((SELECT pmid FROM playmodes WHERE titel = 'TEAM'), 3)";
				statement.execute(insertPlaymodeTeamsTEAM);
			}

			String insertPlaymodeTeamsUNDERDOGTeam = "INSERT INTO playmodeteams (pmid, size) VALUES ((SELECT pmid FROM playmodes WHERE titel = 'UNDERDOG'), 3)";
			statement.execute(insertPlaymodeTeamsUNDERDOGTeam);
			
			String insertPlaymodeTeamsUNDERDOGSolo = "INSERT INTO playmodeteams (pmid, size) VALUES ((SELECT pmid FROM playmodes WHERE titel = 'UNDERDOG'), 1)";
			statement.execute(insertPlaymodeTeamsUNDERDOGSolo);
			
			alstLog.add("Table playmodeTeams filled");
			log.setListData(alstLog.toArray(new String[0]));
			
			
//			###CREATING TABLE GAMES###
			
			alstLog.add("Creating Table games...");
			log.setListData(alstLog.toArray(new String[0]));
			String createGames = "CREATE TABLE games ("
								+ "gid INTEGER NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY, "
								+ "pmID INTEGER REFERENCES PLAYMODES (pmID),"
								+ "winner INTEGER REFERENCES PLAYMODETEAMS (pmtID),"
								+ "gamestart TIMESTAMP DEFAULT CURRENT_TIMESTAMP)";
			statement.executeUpdate(createGames);
			alstLog.add("Table games created");
			log.setListData(alstLog.toArray(new String[0]));
			
//			###CREATING TABLE GAMERUSERLRATIONSHIPS###
			
			alstLog.add("Creating gameUserRelationships games...");
			log.setListData(alstLog.toArray(new String[0]));
			String createGameUserRelationships = "CREATE TABLE gameUserRelationships ("
												+ "gurID INTEGER NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY, "
												+ "gID INTEGER REFERENCES GAMES (gID),"
												+ "uID INTEGER REFERENCES USERS (uID),"
												+ "team INTEGER)";
			statement.executeUpdate(createGameUserRelationships);
			alstLog.add("Table gameUserRelationships created");
			log.setListData(alstLog.toArray(new String[0]));
			
			statement.close();
			connection.close();
			alstLog.add("Connection closed");
			log.setListData(alstLog.toArray(new String[0]));
			
		} catch (Exception e) {
			new ServerResultFrame(e.getMessage());
		}
	}