码迷,mamicode.com
首页 > 数据库 > 详细

mysql更新大字段

时间:2016-05-23 10:49:06      阅读:291      评论:0      收藏:0      [点我收藏+]

标签:mysql更新大字段

																			<input id="btn_sealchange" type="button" value="更改印章"
																				class="btn btn-info"
																				onclick="selectSeal(${seal.sealImageId});">
																			<input id="sealinfo" name="file" type="file"
																				onchange="updateSeal(${seal.sealImageId});"
																				style="display: none">




function selectSeal() {
	document.getElementById("sealinfo").click();
}

function updateSeal(sealimageupdateId) {
	var sealinfo = {};
	sealinfo.sealimageupdateId = sealimageupdateId;
	$.ajaxFileUpload( {
		url : ‘${pageContext.request.contextPath}/seal/uploadSealInfo.do‘,
		secureuri : false,
		fileElementId : ‘sealinfo‘,
		dataType : ‘json‘,
		data : sealinfo,
		success : function(data, status) {
			if (data == "0") {
				location.reload();
			} else {
				alert("上传失败");
			}
		},
		error : function(data, status, e) {
			alert(e);
		}
	});
}




	@RequestMapping(value = "uploadSealInfo")
	public @ResponseBody String uploadSealInfo(
			@RequestParam(value = "file", required = false) MultipartFile file,
			@RequestParam(value = "sealimageupdateId") Long id,HttpServletResponse response) {
		try {
			byte[] sealByte = file.getBytes();
			SealInfo sealInfo = new SealInfo();
			sealInfo.setFileData(sealByte);
			sealInfo.setId(id);
			this.sealService.uploadSeal(sealInfo);
			return "0";
		} catch (IOException e) {
			e.printStackTrace();
			return "-1";
		}

	}
	
	

	
 <!-- mybatis  后台更新blob字段数据 -->
	<update id="updateByPrimaryKeySelective" parameterType="com.itrus.msign.entity.SealInfo">
		update seal_info set file_data=#{fileData}
		where id = #{id,jdbcType=BIGINT}
   </update>	

	
	


mysql更新大字段

标签:mysql更新大字段

原文地址:http://yjm199.blog.51cto.com/4408395/1782046

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!