Oracle blob demo
来源:互联网 发布:excel文件恢复软件 编辑:程序博客网 时间:2024/05/01 18:48
public void saveBlob(String path) throws SQLException, FileNotFoundException, IOException { //ITRDR_environment.xlsx PreparedStatement pstmt= connection.prepareStatement("update blob_FILE set file =?where id =123456");
InputStream is = new FileInputStream(path+"22.xlsx"); pstmt.setBinaryStream(1, is,is.available()); pstmt.executeUpdate(); connection.commit(); is.close(); } public void getBlob(String path) throws SQLException, FileNotFoundException, IOException { String query = "SELECT FILE FROM blob_FILE where id =123456"; java.sql.Blob blob= null; preparedStatement = connection.prepareStatement(query); resultSet = preparedStatement.executeQuery(); while (resultSet.next()) { blob = resultSet.getBlob("FILE"); } InputStream ins= blob.getBinaryStream(); OutputStream ops = new FileOutputStream(new File(path+"11.xls")); byte[]b = new byte[1024]; int len = 0; while((len=ins.read(b))!=-1) { ops.write(b, 0, len); } ops.close(); ins.close(); }
0 0
- Oracle blob demo
- Oracle Blob
- Oracle Blob
- ORACLE操作BLOB字段
- Oracle数据库中的BLOB
- oracle----blob vs clob
- Oracle Blob 插入
- oracle 创建blob
- Oracle Blob读写过程
- 读取oracle blob字符串
- oracle blob数据存取
- Oracle Insert BLOB
- oracle blob的写入
- ORACLE之 访问 BLOB
- oracle bfile blob
- oracle clob/blob
- java oracle Blob
- JDBC ORACLE BLOB处理
- OAF 个性化设置
- 神的规范:排序算法(五):归并排序
- 什么是ptlib
- BAT批处理:获取文件名(不含后缀)、执行SQL语句及数据导入
- Elasticsearch的field类型。
- Oracle blob demo
- VS2013+Win8驱动开发并部署到虚拟机环境搭建
- mtdblock.c中的算法思想
- 用g++编译生成动态连接库*.so的方法及连接
- 通过RS232发送和接收短信(二)
- 那些争议最大的编程观点
- 结构体内引用数组
- php面向对象----构造函数和析构函数
- ELK平台性能优化(不断完善中)