public static File getMstxHeadFile(int tid, String fileName) {
		File file = null;
		Connection con = DBUtil.getConnection();
		Statement st = null;
		ResultSet rs = null;
		try {
			st = con.createStatement();
			String sql = "select tdata from mstx_head where tid='" + tid + "'";
			System.out.println("SQL: " + sql);
			rs = st.executeQuery(sql);

			InputStream is = null;
			while (rs.next()) {
				Blob blob = (Blob) rs.getBlob("tdata");
				if (null != blob) {
					System.out.println("读取成功");
				} else {
					System.out.println("读取失败");
				}
				is = new BufferedInputStream(blob.getBinaryStream());
			}

			byte[] buf = new byte[1024];
			int len = 0;
			file = new File(fileName);
			FileOutputStream outs = new FileOutputStream(file);
			BufferedOutputStream output = new BufferedOutputStream(outs);
			System.out.println("OutputStream is ini");
			while ((len = is.read(buf, 0, 1024)) != -1) {
				System.out.println("output...");
				output.write(buf, 0, len);
			}
			if (is != null) {
				is.close();
			}
			if (output != null) {
				output.close();
			}
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			try {
				if (con != null) {
					con.close();
					con = null;
				}
			} catch (Exception e) {
				e.printStackTrace();
			}
		}

		return file;
	}