• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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);
 
reply
    Bookmark Topic Watch Topic
  • New Topic