Java Stored Function colud'nt find network path.
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.