private static boolean upgradeDatabase() {
		Connection connection = null;
		PreparedStatement statement = null;
		ResultSet results = null;
		String stepMessage = "check database version!";
		try {
			connection = DriverManager.getConnection(url, username, password);
			statement = connection.prepareStatement(GET_SETTING_COMMAND);
			statement.setString(1, "version");
			results = statement.executeQuery();
			if (results.next()) {
				String versionString = results.getString("value");
				int version;
				try {
					version = Integer.valueOf(versionString);
					
					if (version > DATABASE_VERSION || version < 1) {
						plugin.log.warning(ChatColor.RED + CraftMailUtil.prependName("Invalid version specified in 'settings' table - overwriting with current version!"));
						stepMessage = "set database version!";
						setSetting("version", String.valueOf(DATABASE_VERSION), connection);
					}
					/*if (version < 2) {
					 * phase = "upgrade database to version 2!";
						// Potential upgrade commands
					}*/
				} catch (NumberFormatException e) {
					plugin.log.warning(ChatColor.RED + CraftMailUtil.prependName("Invalid version specified in 'settings' table - overwriting with current version!"));
					setSetting("version", String.valueOf(DATABASE_VERSION), connection);
					return false;
				}
			} else {
				// First run - let's set the version
				stepMessage = "set database version!";
				setSetting("version", String.valueOf(DATABASE_VERSION), connection);
			}
			return true;
		} catch (SQLException e) {
			plugin.log.severe(ChatColor.RED + CraftMailUtil.prependName("Failed to " + stepMessage));
			e.printStackTrace();
			return false;
		} finally {
			try {
				if (statement != null) {
					statement.close();
				}
				if (connection != null) {
					connection.close();
				}
				if (results != null) {
					results.close();
				}
			} catch (SQLException e) {
				plugin.log.severe(ChatColor.RED + CraftMailUtil.prependName("Failed to close connection!"));
				e.printStackTrace();
				return false;
			}
		}
	}