Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataSource Question

Status
Not open for further replies.

lambros

Programmer
Oct 10, 2002
42
0
0
US
Hi,

Is it possible to use a textfile as a data source?
If yes, how do I do this...

L.
 
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.
 
Thanks meadandale,

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.....
 
Just have the servlet or jsp read the file from the filesystem and display it in HTML.
 
Thanks again meadandale,

Now do you know where I can get some tutorials , source code, info on this topic?

 
Tutorials on what? Jsp/servlets?

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.

Have fun!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top