• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Any datatype to store files of size greater than 20k

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Iam having 2 fields in my table to store files. BLOB can insert files of size < 4k and update files of size <2k. CLOB can do both insert and update of files <4k. LONG RAW datatype is not suporting 2 fields in the same table...Any ideas as how to implement a datatype for 2 fields where i can store files of size greater than 20k will be most welcome

Sowjanya
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which DataBase are you using? Because if it is Oracle a BLOB can store <4 Gigabytes of data, not < 4Kb. Typically too - again if you are using Oracle - you shouldn't use the LONG RAW datatype. BLOBs can store double the amount of data than LONG RAW ( <4Gb rather than < 2Gb). You can have multiple BLOBs in one table, but only one LONG RAW. Also BLOBs support random access to data whereas LONGs only support sequential access.
[ March 16, 2005: Message edited by: Paul Sturrock ]
 
sowjan kumar
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Paul,
Yeah..At last I fould a solution by having BLOB as such..As u said Iam using oracle database. The following is the code i used

insert into blob_details values(empty_blob(),empty_blob()) //initially i inserted an empty blob. No matter whether BLOB datatype in oracle is declared as NULL or NOT NULL.. we can follow this one..Then for updation of BLOB

select blob,blob_tree from blob_details where id=? for update

prepareStmt = con.prepareStatement (sql,ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
.
.
.
con.setAutoCommit(false);
...
...//all necessary stream operation
...
con.commit ();//done after closing the streams...
 
knowledge is the difference between drudgery and strategic action -- tiny ad
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic