Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to upload size > 4k file to oracle BLOB field

 
max seto
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all, i'm using Oracle 9i and ibm websphere to develop a java application.
i have used CMP to insert images into BLOB field in oracle.
i used byte[] mapping to BLOB.i did it successfully.
however, i'm facing another problem. it is that
the oracle or JDBC (i'm not sure actually) restricts the file size which is larger than 4k inserting into the BLOB field.
is that any solution to solve this restriction?
it is very urgent, pls help!
thx a lot
 
Sergiu Truta
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The creation of the table should be something like this (this is taken from Oracle):

create table PROPOSAL
(Proposal_ID NUMBER(10),
Recipient_Name VARCHAR2(25),
Proposal_Name VARCHAR2(25),
Short_Description VARCHAR2(1000),
Proposal_Text CLOB,
Budget BLOB,
Cover_Letter BFILE,
constraint PROPOSAL_PK primary key (Proposal_ID))
storage (initial 50K next 50K pctincrease 0)
tablespace PROPOSALS
lob (Proposal_Text, Budget) store as
(tablespace Proposal_Lobs
storage (initial 100K next 100K pctincrease 0)
chunk 16K pctversion 10 nocache logging);

As you see you can specify the initial size.
Another posibility would be using BFILE. BFILE is defined like this:
Binary File; read-only binary data stored outside the database, the length of which is limited by the operating system
Hope this helps.
 
max seto
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
create table PROPOSAL
(Proposal_ID NUMBER(10),
Recipient_Name VARCHAR2(25),
Proposal_Name VARCHAR2(25),
Short_Description VARCHAR2(1000),
Proposal_Text CLOB,
Budget BLOB,
Cover_Letter BFILE,
constraint PROPOSAL_PK primary key (Proposal_ID))
storage (initial 50K next 50K pctincrease 0)
tablespace PROPOSALS
lob (Proposal_Text, Budget) store as
(tablespace Proposal_Lobs
storage (initial 100K next 100K pctincrease 0)
chunk 16K pctversion 10 nocache logging);
could you explain more detail about the size setting?
let say, which part is to specify the size of the BLOB?
the 50K setting or 100K setting?
thank you for you help!
 
Sergiu Truta
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The blob configuration is in here:

lob (Proposal_Text, Budget) store as
(tablespace Proposal_Lobs
storage (initial 100K next 100K pctincrease 0)
chunk 16K pctversion 10 nocache logging);
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic