To add a new JNDI data source resource, you must make an entry
must for the connection cache in the <Resource
name>
section of server.xml file
located in SYBASE\tomcat\conf if
you are using Tomcat. If you are using EAServer refer to the EAServer
System Administration Guide for instructions on creating a
new JNDI resource.
Here is the entry in web.xml for the portal database:
<resource-ref> <description>PortalDatabase</description> <res-ref-name>jdbc/portaldb</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref>
There are several instances of web.xml in the Unwired Accelerator installation. The initial instance is located in SYBASE\tomcat\conf as part of the original Unwired Accelerator installation. Each subsequent instance of web.xml is created and configured when a Web application is deployed; for example, when Mobile Web Studio is deployed, SYBASE\tomcat\webapps\onepage \WEB-INF\web.xml is created and configured. Each deployed Web application has its own web.xml file in that application’s associated WEB-INF directory.
All configured web.xml entries and resources are placed in the java:comp/env portion of the JNDI namespace.
Creating a new entry in web.xml
Open web.xml in a text editor. This file is located in SYBASE\tomcat\webapps\onepage\WEB-INF.
Create a new <resource-ref>
section.
You may want to copy and paste another <resource-ref>
section
and edit the existing entries with the new information.
Save the file and close the text editor.
Restart the database server and the application server.
Creating a new entry in server.xml
Open server.xml in a text editor. On Tomcat, this file is located in SYBASE\tomcat\conf. A resource description for each database is included in the file. Here is the entry for the portal database (PortalDB):
<Resource name="jdbc/portaldb"
auth="Container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/portaldb">
<parameter>
<name>driverClassName</name>
<value>com.sybase.jdbc2.jdbc.SybDriver</value>
</parameter>
<parameter>
<name>driverName</name>
<value>jdbc:sybase:Tds:localhost:4747?
ServiceName=portaldatabase</value>
</parameter>
<parameter>
<name>user</name>
<value>dba</value>
</parameter>
<parameter>
<name>password</name>
<value>SQL</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>20</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>10</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>20000</value>
</parameter>
</ResourceParams>
On EAServer, use EAServer Manager to create the new entry. See the instructions in the EAServer System Administration Guide, in the section called “Database Access.”
Create a new entry for the database resource. To create a new entry, see the instructions at http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html.
Save the file and close the text editor.
Restart the database server and the application server.
Copyright © 2005. Sybase Inc. All rights reserved. |