• 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
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Inserting Blob throws Exception

 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Guys,

I'm trying to insert a Blob datatype to a table and I run into the following exception:



My method that does the insert,



I use a Oracle 10.2.0 and JDK 1.4. Any idea as to what is going on?
 
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jothi,

Blob columns need to initialize blob place holders, i suppose.
So do you mind first inserting "empty_blob()" and then updating it with blob content?

Something like this.

Regards,

Fatih.
 
Joe San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The problem is not with emply_blob but rather the size limitation of the Blob datatype in Oracle when using a thin JDBC driver.
 
Fatih Keles
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How did you figure it out, and how did you solve it? Curious to learn

Regards,

Fatih.
 
Joe San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, I get my connection object from the Tomcat JNDI where my web application is deployed. There is a connection property setting that I could do in order to have my CLOB inserted (I changed my BLOD datatype to CLOB) and this is the "SetBigStringTryClob", "true". But I was unable to set this in the Resource configuration in the context.xml of my Tomcat. So the Connection that I get from Tomcat seems not to fit for this situation. So I had to create another explicit Connection through my application and set this property explicitly there and do the insert and retrieval which now seems to work fine.

The following is what I have in the context.xml of my Tomcat



I really cannot understand why the connectionProperties is not respected by Tomcat. If I run using this setting I still keep getting the below exception... (sorry it is in German)



But however when having specifically creating a Connection object through my application rather than using Tomcat JNDI look up, I was able to get it done.

 
Joe San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any reason as to why Tomcat is not able to do this?
 
Joe San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Somehow managed to get it work using Tomcat JNDI. Just did the following...

Replaced the classes12.jar from the tomcat/common/lib directory to a ojdbc14.jar and it worked!
 
reply
    Bookmark Topic Watch Topic
  • New Topic