public int getLastID(String table, String nameID){
		int n = 0;
		try {
			con = DriverManager.getConnection(url, user, password);
			Statement stmt;
			stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
					ResultSet.CONCUR_READ_ONLY);
			ResultSet rs = stmt.executeQuery("select * from " + table + " order by " + nameID);
			rs.last();
			rs.getInt(1);
			n = rs.getInt(1);
		} catch (SQLException ex) {
			Logger lgr = Logger.getLogger(QueryMethod.class.getName());
			lgr.log(Level.SEVERE, ex.getMessage(), ex);

		} finally {

			try {
				if (pst != null) {
					pst.close();
				}
				if (con != null) {
					con.close();
				}

			} catch (SQLException ex) {
				Logger lgr = Logger.getLogger(QueryMethod.class.getName());
				lgr.log(Level.SEVERE, ex.getMessage(), ex);
			}

		}
		return n;
	}