You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Eclipse code style code-style.xml

Tomcat Setting for Connection Pool (JNDI) for SQL Server 2005

  • Edit conf/context.xml like below:
    <?xml version='1.0' encoding='utf-8'?>
    <Context>
        <!-- definition of DB connection resource -->
        <Resource name="jdbc/mmsql"
        	auth="Container"
        	type="javax.sql.DataSource"
        	driverClassName="net.sourceforge.jtds.jdbc.Driver"
        	url="jdbc:jtds:sqlserver://[server]/[database]"
        	username="[username]"
        	password="[password]"
        	maxActive="8"
        	maxIdle="4"
        />
    
        <WatchedResource>WEB-INF/web.xml</WatchedResource>
    </Context>
    
  • Add the following code in <web-app> tag in webapps/[your_webapps]/WEB-INF/web.xml:

    	<resource-ref>
    		<description>DB connection description</description>
    		<res-ref-name>jdbc/mmsql</res-ref-name>
    		<res-type>javax.sql.DataSource</res-type>
    		<res-auth>Container</res-auth>
    	</resource-ref>
    
  • No labels