File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Insert CLOB data upto 2 GB data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Insert CLOB data upto 2 GB data" Watch "Insert CLOB data upto 2 GB data" New topic
Author

Insert CLOB data upto 2 GB data

Vamsi bhujanga
Greenhorn

Joined: Jun 14, 2008
Posts: 16
I need to store huge data (which is a xml data) in a CLOB datatype which is running on JBoss server.Iam successful in writing the code but my code has a big limitation that it can store upto 32523 (approx) characters.But,my application will be receiving the xml's of upto 2 GB (Approximately). But,iam unable to find the alternate for this.



When iam using to create CLOB object directly,it is giving Class Cast exception,thats the reason, i have tried using the above code.

I have tried to create clob in the following way which is giving Class cast exception.




Hence i tried using WrappedConnection of JBoss

But still throwing class cast exception.
Did anyone had this kind of issue/problem of storing more than 2 GB data into CLOB datatype?Is there any another alternate for this?
Please let me know

Thanks in advance.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12788
    
    5
How about storing the monster data as a file with a unique name and putting the name in the database?

Bill
Vamsi bhujanga
Greenhorn

Joined: Jun 14, 2008
Posts: 16
We cant save it in the form of a file as we have many challenges in using it.
Is there any other alternate?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41873
    
  63
What kinds of challenges? Storing it in the DB will present substantial challenges as well (larger challenges probably than using the file system).


Ping & DNS - my free Android networking tools app
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Adding a "Me too!"

We have a similar problem to this and storing a handle to the file and using a file system to store the actual file is definitely the way to go, for all sorts of performance reasons etc.


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12788
    
    5
As I understand it, the underlying mechanism by which DBs store large Blob and Clob objects is in fact by writing a file and only storing the file location in the DB tables.

Bill
 
Consider Paul's rocket mass heater.
 
subject: Insert CLOB data upto 2 GB data