Typically this abstraction is done a layer higher using the DAO pattern. You can create different DAO implementations for your various storage formats including XML, flat file and relational database.
If you want to register a DataSource with a JNDI provider and have that DataSource use a flat file, you will likely encounter problems. The javax.sql.DataSource interface deals with java.sql.Connection objects. You would confuse users of your API that are expecting to be able to use the DataSource to get Connection objects and deal with them according to standard JDBC standards.
In that case what is the best method to publish a log file over the web? I'd like to use JSP / servlets, as I don't just want to serve the plain log file.....
There is plenty of info on this topic, just do a search in google. Reading the file in is basic java i/o and there are plenty of tutorials on that too.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.