Sun Java System Web Server 6.1 SP10 Administrator's Configuration File Reference

Resource Elements

Resource elements are as follows:

RESOURCES

Contains configured resources, such as database connections.

Subelements

The following table describes subelements for the RESOURCES element.

Table 2–37 RESOURCES Subelements

Element  

Required  

Description  

CUSTOMRESOURCE

zero or more 

Defines a custom resource. 

EXTERNALJNDIRESOURCE

zero or more 

Defines a resource that resides in an external JNDI (Java Naming and Directory Interface) repository. 

JDBCRESOURCE

zero or more 

Defines a JDBC (Java Database Connectivity) resource.  

JDBCCONNECTIONPOOL

zero or more 

Defines the properties that are required for creating a JDBC connection pool. 

MAILRESOURCE

zero or more 

Defines the properties that are required for creating a mail resource. 

Attributes

none

CUSTOMRESOURCE

Defines a custom resource, which specifies a custom server-wide resource object factory. Such object factories implement the javax.naming.spi.ObjectFactory interface.

Subelements

The following table describes subelements for the CUSTOMRESOURCE element.

Table 2–38 CUSTOMRESOURCE Subelements

Element  

Required  

Description  

DESCRIPTION

zero or one 

Contains a text description of this element. 

PROPERTY

zero or more 

Specifies a property or a variable. 

Attributes

The following table describes attributes for the CUSTOMRESOURCE element.

Table 2–39 CUSTOMRESOURCE Attributes

Attribute  

Default  

Description  

jndiname

none 

Specifies the JNDI name for the resource. 

restype

none 

Specifies the fully qualified type of the resource. 

factoryclass

none 

Specifies the fully qualified name of the user-written factory class, which implements javax.naming.spi.ObjectFactory.

enabled

true 

(optional) Determines whether this resource is enabled at runtime. Legal values are on, off, yes, no, 1, 0, true, false.

EXTERNALJNDIRESOURCE

Defines a resource that resides in an external JNDI repository. For example, a generic Java object could be stored in an LDAP server. An external JNDI factory must implement the javax.naming.spi.InitialContextFactory interface.

Subelements

The following table describes subelements for the EXTERNALJNDIRESOURCE element.

Table 2–40 EXTERNALJNDIRESOURCE Subelements

Element  

Required  

Description  

DESCRIPTION

zero or one 

Contains a text description of this element. 

PROPERTY

zero or more 

Specifies a property or a variable. 

Attributes

The following table describes attributes for the EXTERNALJNDIRESOURCE element.

Table 2–41 EXTERNALJNDIRESOURCE Attributes

Attribute  

Default  

Description  

jndiname

none 

Specifies the JNDI name for the resource. 

jndilookupname

none 

Specifies the JNDI lookup name for the resource. 

restype

none 

Specifies the fully qualified type of the resource. 

factoryclass

none 

Specifies the fully qualified name of the factory class, which implements javax.naming.spi.InitialContextFactory.

enabled

true

(optional) Determines whether this resource is enabled at runtime. Legal values are on, off, yes, no, 1, 0, true, false.

JDBCRESOURCE

Defines a JDBC (javax.sql.DataSource) resource.

Subelements

The following table describes subelements for the JDBCRESOURCE element.

Table 2–42 JDBCRESOURCE Subelements

Element  

Required  

Description  

DESCRIPTION

zero or one 

Contains a text description of this element. 

PROPERTY

zero or more 

Specifies a property or a variable. 

Attributes

The following table describes attributes for the JDBCRESOURCE element.

Table 2–43 JDBCRESOURCE Attributes

Attribute  

Default  

Description  

jndiname

none 

Specifies the JNDI name for the resource. 

poolname

none 

Specifies the name of the associated JDBC connection pool, defined in a JDBCCONNECTIONPOOL element.

enabled

true

(optional) Determines whether this resource is enabled at runtime. Legal values are on, off, yes, no, 1, 0, true, false.

JDBCCONNECTIONPOOL

Defines the properties that are required for creating a JDBC connection pool.


Note –

The restype attribute of the JDBCCONNECTIONPOOL element is reserved and ignored in Sun Java System Web Server 6.1. Any value set for this attribute is ignored by the server.


Subelements

The following table describes subelements for the JDBCCONNECTIONPOOL element.

Table 2–44 JDBCCONNECTIONPOOL Subelements

Element  

Required  

Description  

DESCRIPTION

zero or one 

Contains a text description of this element. 

PROPERTY

zero or more 

Specifies a property or a variable. 

CONNECTIONPROPERTY

zero or more 

Specifies the connection properties for the connection pool. 

Attributes

The following table describes attributes for the JDBCCONNECTIONPOOL element.

Table 2–45 JDBCCONNECTIONPOOL Attributes

Attribute  

Default  

Description  

name

none 

Specifies the name of the connection pool. A JDBCRESOURCE element's poolname attribute refers to this name.

datasourceclassname

none 

Specifies the class name of the associated vendor-supplied data source. This class must implement java.sql.DataSource or java.sql.XADataSource or both.

steadypoolsize

8

(optional) Specifies the initial and minimum number of connections maintained in the pool. 

maxpoolsize

32

(optional) Specifies the maximum number of connections that can be created to satisfy client requests. 

maxwaittime

60000

(optional) Specifies the amount of time, in milliseconds, that the caller is willing to wait for a connection. If 0, the caller is blocked indefinitely until a resource is available or an error occurs.

poolresizequantity

2

(optional) Specifies the number of connections to be destroyed if the existing number of connections is above the steady-pool-size (subject to the max-pool-size limit). This is enforced periodically at the idle-time-out-in-seconds interval. An idle connection is one that has not been used for a period of idle-time-out-in-seconds.

idletimeout

300

(optional) Specifies the maximum time that a connection can remain idle in the pool. After this amount of time, the pool can close this connection. 

transactionisolationlevel

default JDBC driver isolation level 

(optional) Specifies the transaction isolation level on the pooled database connections. Allowed values are read-uncommitted, read-committed, repeatable-read, or serializable.

Applications that change the isolation level on a pooled connection programmatically risk polluting the pool, which can lead to errors. See isolationlevelguaranteed for more details.

isolationlevelguaranteed

true

(optional) Applicable only when transactionisolationlevel is explicitly set. If true, every connection obtained from the pool is guaranteed to have the desired isolation level. This may impact performance on some JDBC drivers. You can set this attribute to false if you are certain that the hosted applications do not return connections with altered isolation levels.

connectionvalidationrequired

false

(optional) Specifies whether connections must be validated before being given to the application. If a resource's validation fails, it is destroyed, and a new resource is created and returned. Legal values are on, off, yes, no, 1, 0, true, false.

connectionvalidationmethod

auto-commit

(optional) Legal values are as follows: 

  • auto-commit (default), which uses Connection.setAutoCommit(Connection.getAutoCommit())

  • meta-data, which uses Connection.getMetaData()

  • table, which performs a query on a table specified in the validation-table-name attribute

validationtablename

none 

(optional) Specifies the table name to be used to perform a query to validate a connection. This parameter is mandatory if and only if connectionvalidationtype is set to table.

failallconnections

false

(optional) If true, closes all connections in the pool if a single validation check fails. This parameter is mandatory if and only if isconnectionvalidationrequired is set to true. Legal values are on, off, yes, no, 1, 0, true, false.

Properties

Most JDBC 2.0 drivers allow use of standard property lists to specify the user, password, and other resource configuration information. Although properties are optional with respect to Sun Java System Web Server, some properties may be necessary for most databases. For details, see Section 5.3 of the JDBC 2.0 Standard Extension API.

When properties are specified, they are passed to the vendor's data source class (specified by the datasourceclassname attribute) using setName(value) methods.

The following table describes some common properties for the JDBCCONNECTIONPOOL element. The left column lists the property name, and the right column describes what the property does.

Table 2–46 JDBCCONNECTIONPOOL Properties

Property  

Description  

user

Specifies the user name for this connection pool. 

password

Specifies the password for this connection pool. 

databaseName

Specifies the database for this connection pool. 

serverName

Specifies the database server for this connection pool. 

port

Specifies the port on which the database server listens for requests. 

networkProtocol

Specifies the communication protocol. 

roleName

Specifies the initial SQL role name. 

datasourceName

Specifies an underlying XADataSource, or a ConnectionPoolDataSource if connection pooling is done.

description

Specifies a text description. 

url

Specifies the URL for this connection pool. Although this is not a standard property, it is commonly used. 

CONNECTIONPROPERTY

Specifies the connection properties for a JDBC connection pool.

Subelements

The following table describes subelements for the CONNECTIONPROPERTY element.

Table 2–47 CONNECTIONPROPERTY Subelements

Element  

Required  

Description  

DESCRIPTION

zero or one 

Contains a text description of this element. 

Attributes

The following table describes attributes for the CONNECTIONPROPERTY element.

Table 2–48 CONNECTIONPROPERTY Attributes

Attribute  

Default  

Description  

name

none 

Specifies a name for the connection property. 

value

none

Specifies a value for the connection property. 

invocationfrequency

at-creation

(optional) Specifies the frequency with which the connection property is invoked. Legal values are at-creation and every-lease.

MAILRESOURCE

Defines a JavaMail (javax.mail.Session) resource.

Subelements

The following table describes subelements for the MAILRESOURCE element.

Table 2–49 MAILRESOURCE Subelements

Element  

Required  

Description  

DESCRIPTION

zero or one 

Contains a text description of this element. 

Attributes

The following table describes attributes for the MAILRESOURCE element.

Table 2–50 MAILRESOURCE Attributes

Attribute  

Default  

Description  

jndiname

none 

Specifies the JNDI name for the resource. 

storeprotocol

imap

(optional) Specifies the storage protocol service, which connects to a mail server, retrieves messages, and saves messages in folder(s). Example values are imap and pop3.

storeprotocolclass

com.sun.mail.imap.IMAPStore

(optional) Specifies the service provider implementation class for storage. 

You can find this class at: 

transportprotocol

smtp

(optional) Specifies the transport protocol service, which sends messages. 

transportprotocolclass

com.sun.mail.smtp.SMTPTransport

(optional) Specifies the service provider implementation class for transport. 

You can find this class at: 

host

none 

The mail server host name 

user

none 

The mail server user name 

from

none 

The e-mail address the mail server uses to indicate the message sender. 

enabled

true

(optional) Determines whether this resource is enabled at runtime. Legal values are on, off, yes, no, 1, 0, true, false.