aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes how to upload size > 4k file to oracle BLOB field Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "how to upload size > 4k file to oracle BLOB field" Watch "how to upload size > 4k file to oracle BLOB field" New topic
Author

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

max seto
Greenhorn

Joined: Feb 06, 2004
Posts: 3
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

Joined: Dec 16, 2003
Posts: 121
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.


...watch me...as I'm walking the path...
max seto
Greenhorn

Joined: Feb 06, 2004
Posts: 3
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

Joined: Dec 16, 2003
Posts: 121
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);
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to upload size > 4k file to oracle BLOB field
 
Similar Threads
Create BLOB Object
Oracle function using Java to return Blob is zero size
Image insertion into database through JPA
Not able to insert image more than 4K in Database
Image insertion into database