Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hi, I'm intrying to upload a file into an ORACLE Database, but I got strange errors

 
Leinad Jan
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

my code is working fine until the last executeUpdate. I'm trying to upload a file into the Oracle Database.



Here is the last error stack trace I got :



Do you have any idea on what is not working correctly ? How do I define a valid LOB Locator ?

Thank you !
 
Fatih Keles
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Leinad,

I don't know what is "FormFile data" is but using streams for updating BLOBs works.
Here is a sample, you may also find many samples on oracle network.

Regards,

Fatih.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34095
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Leinad,
I usually use setBinaryStream() for BLOBs so I don't have deal with database specific code. It also eliminates the need to get a BLOB object before trying to write to the database.
 
Leinad Jan
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your help !
 
sonam kapoor
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, checkout the example for uploading a file in oracle database while working with BLOB

1. To upload and retrieve multiple images

2. To upload and retrieve text and image data
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic