然后只要在form中加上enctype="mult 下面我們在數據庫中建立一張表。
DROP TABLE ATTACHMENT;
create table Attachment
(
AttachID INT not null, --自動增長號
AttachFilename VARCHAR2(250) null, --文件名
AttachFileSize INT not null, --文件大小
AttachMimeType VARCHAR2(70) null, --文件類型
AttachDesc VARCHAR2(250) null, --說明
AttachCreationIP VARCHAR2(20) not null, --上傳的IP
AttachCreationDate TIMESTAMP not null, --創建時間
AttachModifiedDate TIMESTAMP not null, --文件保存路徑
ATTACHFILEPATH VARCHAR2 (250) NOT NULL,
PRimary key (AttachID)
);
create or replace trigger Attach_trig_autoinc
before insert on Attachment
for each row
begin
if (:new.AttachID is null) then
select Attachment_seq.nextval into :new.AttachID from dual;
end if;
end;
字段的內容都很簡單。
下面建立ibatis的SQL map文件。建立標準的insert、update、delete和find的SQL。相信看過前面系列文章的朋友對此已經很熟悉了。
(未完待續)新聞熱點
疑難解答