This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

not able to insert xml file in oracle database using java(only first three lines are inserting)

 
ripu sudan
Greenhorn
Posts: 20
Java Linux Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I need to insert a large xml file (>=4k) in oracle database using java and i am using following program.but it is inserting only first three line as given blow however characters in file are about 4k.


code i am using
and datatype is CLOB
 
Martin Vajsar
Sheriff
Pie
Posts: 3747
62
Chrome Netbeans IDE Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use simple setString if the CLOB is under 32 KB. (That is, read the file into memory and then use setString).

See also an older post of mine (and another one) where I've discussed how to insert a BLOB. CLOB can be done in the same manner, just use the setCharacterStream() instead of setBytes().

I don't know exactly why your solution doesn't work. The ones I'm posting here are tried and tested. Other approaches, perhaps even database independent, are certainly possible too, but I didn't ever need anything else.
 
ripu sudan
Greenhorn
Posts: 20
Java Linux Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi geeks complete xml was inserted in database ,problem was in viewing file from database ,after setting some parameters i am able to see xml file.
here are parameters which is set in putty console.

set long 9999
set pagesize 50000
set linesize 157

program is working fine...

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic