My existing web application gets database pooling parameters from context. Now, I'm developing a new web service to be deployed as a separate application, but using the previous database.
In this new web service application, I am not using any servlet, as well as JSPs. They'll just be a collection of service classes. In such a case, how do I get the context parameters?
In the earlier case when I'm using a servlet, my context is as below:
<?xml version="1.0" encoding="UTF-8"?>
<Context antiResourceLocking="false" privileged="true" >
<Resource
name="jdbc/NetmarketDB"
auth="Container"
type="javax.sql.DataSource"
removeAbandoned="true"
removeAbandonedTimeout="30"
maxActive="100"
maxIdle="30"
maxWait="1000"
username="root"
password="xxxxxxxx"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/netmarket"/>
</Context>
... and I get the context from a servlet or JSP as below:
Connection conn = MySqlDB.getDBConnection(getServletContext());
But now that I'm not using any servlet/JSP, I'm confused. Please help me out.
Thanks in advance.
James.