Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Java Stored Function colud'nt find network path.

MasafumiKokuiFeb 13 2012 — edited Feb 13 2012
Hi All,
I've create Java stored function that is import file to BLOB Object.
But. coud'nt access network path..

I call this function from pl/sql.
--
public static long loadBlob( BLOB blob, String dirName, String fileName)
{
File dir = null;
File file = null;
FileInputStream fis = null;
OutputStream os = null;

try {
dir = new File( dirName );
if( !dir.exists() ) {
return -1L;
}
file = new File( dir, fileName );
fis = new FileInputStream( file );
os = blob.getBinaryOutputStream();
byte[] buffer = new byte[ blob.getBufferSize() ];

int length = -1;
while ( ( length = fis.read( buffer ) ) != -1 ) {
os.write( buffer , 0 , length );
}
return blob.length();
} catch (Exception e) {
e.printStackTrace();
return -1L;
} finally {
try { fis.close(); } catch( Exception ignore ) {}
try { os.close(); } catch( Exception ignore ) {}
}
--


-String dirName
This is OK.
 d:\temp\
 \\localhost\d$\temp\
 z:\temp\ (「\\localhost\d$」 Mapping z drive. )

This is NG.
 \\127.0.0.1\d$\temp\
 z:\temp\ (「\\127.0.0.1\d$」 Mapping z drive )
 \\[Other Host IP Address]\Share\
 z:\temp\ (「[Other Host IP Address]\Share\」 Mapping z drive )


All pattern success, I've create main function in Java.
Oracle Service and Listener Service Login with administrator account.
(I chaged Local System acclount.)

Any Setting Need?
Please help me.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 12 2012
Added on Feb 13 2012
4 comments
143 views