DButils实现clob和blob存储
来源:互联网 发布:js下载文件到本地 编辑:程序博客网 时间:2024/06/08 15:30
//使用dbutils实现大文本对象的存储. @Test public void testClob() throws Exception{ String sql="insert into article (content)values(?)"; File file=new File("bin/stylesheet.css"); char[] c=new char[(int)file.length()]; FileReader reader=new FileReader(file); reader.read(c); SerialClob clob=new SerialClob(c); QueryRunner runner=new QueryRunner(JDBCUtils.getDataSource()); runner.update(sql, clob); } //使用dbutils实现二进制对象的存储. @Test public void testBlob() throws Exception{ String sql="insert into image (content)values(?)"; File file=new File("bin/bg.jpg"); byte[] b=new byte[(int)file.length()]; InputStream in=new FileInputStream(file); in.read(b); SerialBlob blob=new SerialBlob(b); QueryRunner runner=new QueryRunner(JDBCUtils.getDataSource()); runner.update(sql,blob); }
转自网络,原作者佚名
0 0
- DButils实现clob和blob存储
- Clob,blob的存储
- Spring Clob,Blob存储
- Blob 和 Clob
- BLOB 和CLOB
- Hibernate Blob和Clob
- clob和blob
- Hibernate + MYSQL结合存储 Blob 和 Clob内容
- Hibernate实现Clob和Blob对象的存取
- 使用Spring JdbcTemplate实现CLOB和BLOB的存取
- 使用Spring JdbcTemplate实现CLOB和BLOB的存取
- Hibernate实现Clob和Blob对象的存取
- 使用Spring JdbcTemplate实现CLOB和BLOB的存取
- Hibernate实现Clob和Blob对象的存取
- Hibernate实现Clob和Blob对象的存取
- 使用Spring JdbcTemplate实现CLOB和BLOB的存取
- jdbc实现对CLOB和BLOB数据类型操作
- Oracle中的BLOB和CLOB
- good blog android
- 矩阵LU分解算法分析
- Base64加密解密原理以及代码实现
- 通过背景模糊设计让你的App优雅精致有质感
- 抽象工厂模式
- DButils实现clob和blob存储
- Poj 2152 Fire (DP_树形DP)
- 策略模式
- 动态库转静态库遇到的问题
- c++获取文件信息——_stat函数的使用
- Minimum Path Sum 最小路径和
- 雅虎天气的那个效果
- Linux 对比文本文件
- Linux系统中 mysql server 之间拷贝用户权限