Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Acessing .properties file after loading into db as JAVA RESOURCE
mj_at_mauryjarrell.com (Maury Jarrell) wrote in message news:<67c512fc.0304240629.185b86b_at_posting.google.com>...
> FileInputStream fin = new FileInputStream( "Hola.properties" );
> Properties hola = new Properties();
> hola.load(fin);
Got the answer from Oracle's Metalink and thought I'd post it here. It was more my Java ignorance than my Oracle ignorance.
Instead of the above, you can do:
hola.load(TestProps.class.getResourceAsStream("Hola.properties"));
This delegates to class loader and searches your classpath for that resource. It works inside and outside of Oracle. ( With no slash in front it pre-pends the package to the resource name... check the javadocs for details )
HTH Somebody,
Maury
Received on Fri Apr 25 2003 - 11:19:31 CDT