如果是oracle数据库好像有一个大字段,可以考虑试试。另外是否可以考虑用程序实现在删除时把文件删除
解决方案 »
- hibernate 学习时的一个问题
- An unexpected exception has been detected in native code outside the VM
- Web Service 添加SSL的问题(答者有分,thanks)
- Hibernate多对多映射(),求指导
- hibernate 的关联问题
- 使用apache soap2.3的问题
- [高手醒目]利用ftp协议实现到ftp服务器的文件断点上传!
- 谁给推荐一本好的ejb的入门书,100送给...
- 请提供基本介绍j2ee入门的书??
- java中BufferedInputStream相较于FileInputStream的优势是那些?
- 一個小問題,在tomcat控制台下同時輸出簡繁體
- 怎样做一个简单的表单设计器?
你可以考虑从数据库取出文件的路径,然后根据路径删除这个问题就可以了
SQL> conn sys/myoracle as sysdba
已连接。
SQL> create or replace directory my_files as 'e:\photo'; 目录已创建。
//授权给用户scott
SQL> grant read on directory my_files to scott; 授权成功。
2、建立一个含有blob类型的字段的表
SQL> show user;
USER 为"SCOTT"
SQL> create table demo
2 ( id int primary key,
3 theBlob blob
4 )
5 / 表已创建。
3、插入
SQL> declare
2 l_blob blob;
3 l_bfile bfile;
4 begin
5 insert into demo values ( 1, empty_blob() )
6 returning theBlob into l_blob;
7
8 l_bfile := bfilename( 'MY_FILES', 'girl.jpg' );
9 dbms_lob.fileopen( l_bfile );
10
11 dbms_lob.loadfromfile( l_blob, l_bfile,
12 dbms_lob.getlength( l_bfile ) );
13
14 dbms_lob.fileclose( l_bfile );
15 end;