SQL Server

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.

StepsSetting up a SQL Server cache for all Web applications:

  1. Copy the msbase.jar, mssqlserver.jar, and msutils.jar to both:

    SYBASE\tomcat\common\lib

    SYBASE\tomcat\webapps\onepage\WEB-INF\lib

  2. 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"/>

  3. 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.

StepsSetting up a SQL Server cache for a Web application:

  1. Copy the msbase.jar, mssqlserver.jar, and msutils.jar to both:

    SYBASE\tomcat\common\lib

    SYBASE\tomcat\webapps\onepage\WEB-INF\lib

  2. 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"/>

  3. 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.