Resource references are used to obtain connector and database connections, and to access JMS connection factories, JavaMail sessions, and URL links.
To add or configure a resource reference, open the Web Application Properties dialog box.
The Resource References tab configuration is the same for Web applications, application clients, and EJB components.
Adding a resource reference
Display the Resource References tab.
Click Add. A reference with default settings is created. Edit the settings as described below.
Editing a resource reference
If necessary, display the Resource References tab. Existing references are displayed as a list with one row for each reference.
Edit the reference fields of interest as follows:
Name The partial JNDI name used in servlet and JSP code. Use the prefix mail/ for
JavaMail references, jdbc/ for data
source references, url/ for java.net.URL
references, and jms/ for javax.jms
references. For example, if your code refers to java:comp/env/jdbc/MyDatabase, enter jdbc/MyDatabase
.
Type Choose the type of resource:
javax.sql.DataSource for JDBC connections. See “JDBC DataSource lookup” for more information.
java.mail.Session for JavaMail sessions. See Chapter 35, “Creating JavaMail,” for more information.
java.net.url for aliased URLs.
javax.jms.QueueConnectionFactory for JMS queue connection factories. See “Looking up a ConnectionFactory object” for more information.
javax.jms.TopicConnectionFactory for JMS topic connection factories. See “Looking up a ConnectionFactory object” for more information.
Sharing Scope Choose Sharable or Unsharable. By default, connections to a resource manager are sharable across EJBs in an application that use the same resource in the same transaction context.
This is available only to Web applications and EJB components.
Authentication Select the source of the authentication credentials:
Application – use the credentials configured for the connection cache.
Container – use the credentials of the caller who logged in to EAServer and created the component instance.
Resource Link Specify the resource link for the resource type:
javax.sql.DataSource – select the name of the EAServer connection cache or connector to be used for this resource.
java.mail.Session – specify the SMTP mail server for outgoing mail.
java.net.url – enter
the URL string, as it would be used to construct a java.net.URL instance
by calling the URL(java.lang.String) constructor.
URLs must contain a protocol and host address, for example: http://www.sybase.com
or ftp://pub.sybase.com
.
javax.jms.QueueConnectionFactory – select the name of the queue connection factory.
javax.jms.TopicConnectionFactory – select the name of the topic connection factory.
To delete a resource reference, click anywhere in the fields for the resource reference of interest and click Delete.
Copyright © 2005. Sybase Inc. All rights reserved. |