| Author |
Any datatype to store files of size greater than 20k
|
sowjan kumar
Greenhorn
Joined: Oct 09, 2004
Posts: 23
|
|
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
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
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 ]
|
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
|
 |
sowjan kumar
Greenhorn
Joined: Oct 09, 2004
Posts: 23
|
|
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...
|
 |
 |
|
|
subject: Any datatype to store files of size greater than 20k
|
|
|