public void syncDatabase(int syncType, String syncData, HttpServletResponse response)
	{
		try
		{
			if(syncType == SyncTypes.SYNC_TRANSACTION)
			{
				// IF TRANSACTION IS SYNCED THEN RUN THE DATA QUERY IN THE SERVER TABLES
				new WriteBase().execute(syncData, new Object[]{});
				sendResponse(response, Boolean.TRUE.toString());
			}
			else if(syncType == SyncTypes.SYNC_MASTER)
			{
				// IF MASTER IS BEING SYNCED THEN CHECK TABLE FOR LATEST INFO. IF THERE THEN SEND INCREMENTAL UPDATE/INSERT
				System.out.println("Syncing Master Table");
				
				String updateQuery = "";
				for (SyncTable syncTable : tablesToSync)
				{
					if(!syncTable.getTableType().equals("Master"))
						continue;
					
					String selectQuery = "Select * from " +syncTable.getName();
//					String selectQuery = "Select * from " +syncTable.getName() +" WHERE client_version != server_version AND server_version > 0;";
					updateQuery = getMasterData(selectQuery, syncTable.getName());

					if (!updateQuery.equals(""))
					{
						sendResponse(response, updateQuery);
					}
				}
				
			}
			else if (syncType == SyncTypes.SYNC_SCHEMA)
			{
				// IF SCHEMA IS BEING SYNCED CHECK CHANGES TO THE SCHEMA AND DO THE NECESSARY UPDATES
			}
		}
		catch(SQLException se)
		{
			se.printStackTrace();
			
			try {
				sendResponse(response, null);
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		catch (IOException e) 
		{
			e.printStackTrace();
		}
	}