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

Need help Urgently

 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All.
I am having a very strange problem. Let me get to it right away.
We are using Weblogic 6.0 running on a Linux box with Oracle 8.1.6 as the DB.
One of the tables has 2 blob fields where we store 2 blobs per request. These two fields are in XML format in the application realm. We use the following method in a preparedStatement for storing the blobs in the DB.
public void setBinaryStream(int parameterIndex,
InputStream x,
int length)
throws SQLException
We use a ByteArrayInputStream for the parameter 'x' above.
Now this is what is happening...
I convert the XML into a ByteArrayInputStream, put it in a preparedStatement with the above method & call the executeUpdate method on it.
When I look retrieve this inserted row, I get back the XML I inserted with 3 fields missing. These three fields are present somewhere in the middle of the XML when I insert it.
What puzzles me more is that this does not happen all the time. Sometimes the retrieval retrieves the complete Blob just fine.
Just to be sure that it is indeed the insertion that is the problem, I do a dbms_lob.getlength(Blob column) & the length of the blob stored in the DB is less than the one I inserted. That proves that the insert is not inserting the data properly & something flaky is happening at the time of the insert.
Any ideas as why this is happening?? Is there a problem with the setBinaryStream( ) method ??? Any suggestions are more than welcome as this has got me completely stumped !
I would appreciate a quick response as this is quite an urgent piece in my app & I need a solution ASAP.
Thanks in advance.
- Himanshu
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic