This section describes two variations for setting up a SQL Server cache – one sets up a global cache that is available to all Web applications, the other sets up a cache that is available to particular Web application.
Setting up a SQL Server cache for all Web applications:
Copy the msbase.jar, mssqlserver.jar, and msutils.jar to both:
SYBASE\tomcat\common\lib
SYBASE\tomcat\webapps\onepage\WEB-INF\lib
Edit SYBASE\tomcat\conf\server.xml and
add the following inside the <GlobalNamingResources>
section:
<Resource name="jdbc/sqlserver"
auth="Container"
type="javax.sql.DataSource"
driverClassName="com.microsoft.jdbc.sqlserver.SQLServerDriver"
url="jdbc:microsoft:sqlserver://win2k3:1433"
username="sa"
password=""
maxActive="20"
maxIdle="10"
maxWait="20000"/>
Edit the SYBASE\tomcat\conf\context.xml file
and add the following inside the <Context>
section:
<Resource name="jdbc/sqlserver"
auth="Container"
type="javax.sql.DataSource"
driverClassName="com.microsoft.jdbc.sqlserver.SQLServerDriver"
url="jdbc:microsoft:sqlserver://win2k3:1433"
username="sa"
password=""
maxActive="20"
maxIdle="10"
maxWait="20000"
removeAbandoned="false"
removeAbandonedTimeout="60"
logAbandoned="false"/>
That should show the sqlserver
cache
as a drop-down in the database capture wizard. You will need to
modify the hostname, port, username, password in the above entries
appropriately for your data source.
Setting up a SQL Server cache for a Web application:
Copy the msbase.jar, mssqlserver.jar, and msutils.jar to both:
SYBASE\tomcat\common\lib
SYBASE\tomcat\webapps\onepage\WEB-INF\lib
Edit the SYBASE\tomcat\webapps\onepage\META-INF\context.xml file and
add the following inside the <Context>
section:
<Resource name="jdbc/sqlserver"
auth="Container"
type="javax.sql.DataSource"
driverClassName="com.microsoft.jdbc.sqlserver.SQLServerDriver"
url="jdbc:microsoft:sqlserver://win2k3:1433"
username="sa"
password=""
maxActive="20"
maxIdle="10"
maxWait="20000"
removeAbandoned="false"
removeAbandonedTimeout="60"
logAbandoned="false"/>
Edit the SYBASE\tomcat\webapps\onepage\WEB-INF\web.xml file
and add the following inside the <web-app>
section:
<resource-ref>
<description>SQLServer Sample DB</description>
<res-ref-name>jdbc/sqlserver</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
That should show the sqlserver
cache
as a drop-down in the database capture wizard. You will need to
modify the hostname, port, username, password in the above entries
appropriately.