public synchronized int updateService(int id, String path, String type, String title, String description) {
		int serviceId = -1;
		
		boolean found = false;
		conn.query("select * from "+SCHEMA+".services where server_id = '"+id+"' and path = '"+path+"' and servicetype = '"+type+"'");
		ResultSet rs = conn.getQueryResult();
		try {
			if( rs.next() ) {
				found = true;
				serviceId = rs.getInt("service_id");
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		if( found ) {

			conn.prepare("UPDATE "+SCHEMA+".services SET serviceType=?, title=?, description=? where service_id = ?");
			PreparedStatement stmt = conn.getPreparedStatement();
			try {
				stmt.setString(1, type);
				stmt.setString(2, title);
				stmt.setString(3, description);
				stmt.setInt(4, serviceId);
				stmt.execute();
				stmt.close();
			} catch (SQLException e) {
				e.printStackTrace();
			}
			
		} else {
			
			conn.prepare("INSERT INTO "+SCHEMA+".services (server_id, path, serviceType, title, description, inserted) VALUES (?,?,?,?,?, now())");
			PreparedStatement stmt = conn.getPreparedStatement();
			try {
				stmt.setInt(1, id);
				stmt.setString(2, path);
				stmt.setString(3, type);
				stmt.setString(4, title);
				stmt.setString(5, description);
				stmt.execute();
				stmt.close();
			} catch (SQLException e) {
				e.printStackTrace();
			}
			
			conn.query("select * from "+SCHEMA+".services where server_id = '"+id+"' and path = '"+path+"' and servicetype = '"+type+"'");
			rs = conn.getQueryResult();
			try {
				if( rs.next() ) {
					serviceId = rs.getInt("service_id");
				}
			} catch (SQLException e) {
				e.printStackTrace();
			}
			
			
		}

		
		return serviceId;
	}