• Post Reply Bookmark Topic Watch Topic
  • New Topic

open/Read file from oracle bfile  RSS feed

 
priya kakkar
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had a project to insert data into Bfile column in oracle DB and read it back in JAVA:

I did as below but getting error @ line where i am trying to open file to read:

*****************************************************************************************

*******************************************************

Error message states:
java.sql.SQLException: ORA-22285: non-existent directory or file for FILEOPEN operation
But file exist in the location mentioned
Please suggest if i have to give some some folder setting at directory level.
Folder is visible to all users to read and write>
 
Liutauras Vilda
Marshal
Posts: 4511
307
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi priya kakkar,

Please use code tags when you post actual code. I have added them for you.
See how better your code looks like?

You could find some useful information how to UseCodeTags (<- link).
 
Campbell Ritchie
Sheriff
Posts: 55351
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happens when you execute that query at the command line? I presume that works; it looks simple enough.

Which line does that Exception occur on? Please show us the exact paths to the class you are executing that code in, and the location of the Oracle program, and the instruction you are using to open the connection.
 
priya kakkar
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Getting error at :
// now open the bfile to get the data
bfile.openFile(); //GETTING RUNTIME ERROR HERE!!!

running code from eclipse @ C:\Data\Softwares\Code backup\PDAutomation8.2\src\com\ing\qa\dbtools
 
Campbell Ritchie
Sheriff
Posts: 55351
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And what is the error? Please post the stack trace and type of Exception. If it is an SQLException please look in your handbook to find what the error code means.
 
Dave Tolls
Ranch Hand
Posts: 2835
30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What output do you get from:

?

Also does Oracle have permission to actually access that directory and file?
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!