× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
--
[ Picked text/plain from multipart/alternative ]
All,

I have a servlet which is using the Toolbox JDBC driver to access the AS/400
database. This is running fine, both in the WTE and when distributed to WAS
on the 400.

However I believe (correct me if I'm wrong) that it will be more efficient
to use the native driver when running on the 400. So rather than recompiling
the code, I want to use a properties file to tell my servlet which class to
use.

So I add the following code to my servlet:

File propPath = new File("mydir\\my.properties");
myProperties = new Properties();

//Load Properties from File
try {
        in = new FileInputStream(propPath);
        myProperties.load(in);
        in.close();
} catch (IOException e) {
}

If I run this code in a "normal" java class, (i.e. with a main method), a
properties file my.properties  is created, if one does not already exist, in
the specified directory. If I put the code in the servlet, I get a file not
found exception.

How can I avoid the exception (why can't the servlet create the file?).
Alternatively, where should I create the file manually, so the servlet
engine finds it?

Thanks,
Chris.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.