• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Joe Ess
  • salvin francis

Any datatype to store files of size greater than 20k

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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...
 
Police line, do not cross. Well, this tiny ad can go through:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!