public static void main(String[] args) {
		
		if (args.length > 0) {
			if (args[0].equalsIgnoreCase("load-database")) {
				System.out.println("Loading database...");
				SqlFortune f = new SqlFortune();
				f.createDb();
				f.loadFromFiles();
				
				System.out.println(f.getFortune());
				System.out.println(f.getFortune("futurama"));
				
				
				f.closeDb();
			}
		} else {
			
			instance = new FortuneBot();
			instance.connect();
			while (instance.running()) {
				try {
					// pause briefly
					Thread.sleep(500);
					if ( !instance.connection.isConnected()) {
						instance.connect();
					}
				}
				catch (InterruptedException ex) {
					System.err.println("Caught Interrupted Exception");
					ex.printStackTrace();
				} 
			
			}
		
			// another delay, so clean up can occur (eg Wismar msg).
			try {
				// pause briefly
				Thread.sleep(2000);
			}
			catch (InterruptedException ex) {
				System.err.println("Caught Interrupted Exception");
				ex.printStackTrace();
			}
				
		}
	}