从数据库读出的JPG文件的字符流,转换成图片显示在页面上的相关代码
从数据库读出的JPG文件的字符流,转换成图片显示在页面上的相关代码
public void doPost(HttpServletRequest req, HttpServletResponse res)
ServletOutputStream out = res.getOutputStream();
try {
setStmt = Con.createStatement();
} catch (Exception e) {
");
String ls_sql = null;
if (ls_sql == null)
ls_sql = ls_sql.trim();
ResultSet rs = null;
rs = dispStmt.executeQuery(ls_sql);
System.out.println(
");
try {
try {
InputStream is = rs.getBinaryStream(1);
byte bzp = new byte[size];
out.write(bzp);
System.out.println("Wirte image error: " + e.toString());
}
} catch (Exception e) {
}
try {
} catch (Exception e) {
}
编辑推荐:
温馨提示:因考试政策、内容不断变化与调整,长理培训网站提供的以上信息仅供参考,如有异议,请考生以权威部门公布的内容为准! (责任编辑:长理培训)
点击加载更多评论>>