public static int updateIntoAdsInfo(int gid) {
		int result = gid;
		Connection con = DBUtil.getConnection();
		PreparedStatement pstmt = null;
		ResultSet rs = null;
		try {
			pstmt = con.prepareStatement("select * from mstx_ads where gid=?");
			pstmt.setInt(1, gid);
			rs = pstmt.executeQuery();// 查询
			if (!rs.next()) {
				result = getMaxNumber("mstx_ads");
				updateMaxNumber(5);// 将该字段值加1
				pstmt = con.prepareStatement("insert into mstx_ads(gid,gdis) values(?,?)");
				pstmt.setInt(1, result);
				pstmt.setString(2, "");
				pstmt.executeUpdate();
			}
		} catch (Exception e) {// 捕获异常
			e.printStackTrace();// 打印异常
		} finally {
			try {
				if (rs != null) {
					rs.close();// 关闭
					rs = null;
				}
			} catch (Exception e) {
				e.printStackTrace();
			}
			try {
				if (pstmt != null) {
					pstmt.close();
					pstmt = null;
				}
			} catch (Exception e) {
				e.printStackTrace();
			}
			try {
				if (con != null) {
					con.close();
					con = null;
				}
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
		return result;
	}