最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
jsp中图片处理相关操作
时间:2022-07-02 17:55:12 编辑:袖梨 来源:一聚教程网
YPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.***w3.org/TR/REC-html40/loose.dtd">
/*
drop table imagetable;
create table imagetable
(
nid int not null,
image blob,
primary key (nid)
)
type = InnoDB;
*/
/*
//================ 一 、将文件写入到数据库的大字段中begin=====================
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
String url ="jdbc:mysql://localhost:3306/test?user=root&password=eastsoftweb";
Connection conn= DriverManager.getConnection(url);
java.io.File file = new File("d:/temp/1.jpg");
FileInputStream is=new FileInputStream(file);
PreparedStatement stmt = conn.prepareStatement(
"INSERT INTO imagetable (nid,image)" +
"VALUES (?, ?)"); //预编译SQL语句
stmt.setInt(1, 1);
stmt.setBinaryStream(2, is,(int)file.length());
stmt.executeUpdate();
stmt.close();
is.close();
out.println("update end");
//===============将文件写入到数据库的大字段中end=========================
*/
/*
//====================== 二、显示服务器硬盘图片示例 begin==============
相关文章
- PicacgIOS如何下载 02-03
- 差差漫画无广告-差差漫画下拉式-差差漫画全免费 02-03
- 差差漫画无限下载-差差漫画免费高清版V5.24 02-03
- 币安的提现是否可以用钱抵税款?还是一定要另付手续费? 02-03
- 羞羞漫画手机网页版-无需下载即可畅享高清完整画质 02-03
- 差差漫画官网正版-差差漫画官网最新版 02-03