Hi, I know how to set up datasource for servlet applications, we have to modify server.xml and web.xml in Tomcat to do the job. I am wondering how I can set up datasource for plain java application such as getting datasource from a main method? I try to do the same as for servlets, but it keep giving set up errors. thanks,
There's not really any advantage. It's just a matter of consistency since you need to use DataSource if you're using JNDI. Sun's hinted that they may deprecate the traditional method of loading/registering the JDBC driver explicitly and leave DataSource as the only technique for connecting to a database. @D
Co-author: "Eclipse in Action: A guide for the Java developer"<br />Author: "Java Oracle Database Development"
subject: How to set up DataSource in plain Java application?