public void run() {

		try (PrintWriter out = new PrintWriter(socket.getOutputStream(), true);
				BufferedReader in = new BufferedReader(new InputStreamReader(
						socket.getInputStream()));) {

			String inputLine, outputLine;
			CommandInterpreter ci = new CommandInterpreter();
			
			if (ci.checkInitialStatus()) {
				out.println(serverTag + helloMessage);
			} else {
				out.println(serverTag + databaseErrorMessage);
				closeSocket();
			}

			while (true) {
				
				out.printf(clientTag);
				inputLine = in.readLine();
				outputLine = ci.handleInput(inputLine);
				out.println(serverTag + outputLine);
				

				if (outputLine.equals(terminationMessage)
						|| outputLine.equals(terminationMessage2)
						|| outputLine.equals(terminationMessage3)
						|| outputLine.equals(databaseErrorMessage2)) {
					break;
				}

			}
			ci.closeInterpreter();
			closeSocket();

		} catch (IOException e) {
			System.err.println("SYSTEM ERROR/Timeout Due To Inactivity"
					+ new Date() + " - Stack Trace Shown Below.");
			e.printStackTrace();
		}
	}