This section describes the guidelines for deploying DataDirect XQuery® on an application server running JBoss 4.x or 5.x.
- Install DataDirect XQuery® by copying the DataDirect XQuery® jar files to JBoss_home/server/server_config/lib, where JBoss_home is your JBoss installation directory, and server_config is your server configuration directory.
- In the JBoss_home/server/server_config/deploy directory, create a DataSource resource file named ddxqexample-ds.xml. The file name must end with the characters -ds.xml so that the JBoss server can recognize it as a DataSource resources file; however, the file name can be prefixed with any set of characters.
For example:
<?xml version="1.0" encoding="UTF-8" ?>
<datasources>
<local-tx-datasource>
<jndi-name>DDXQExample</jndi-name>
<use-java-context>false</use-java-context>
<connection-url>jdbc:datadirect:xquery3://jdbcUrl=
{jdbc:xquery:sqlserver://localhost:1433;databaseName=ddxq_example}
</connection-url>
<driver-class>com.ddtek.xquery3.jdbc.XQueryDriver</driver-class>
<user-name>john</user-name>
<password>topsecret</password>
<check-valid-connection-sql>SELECT * FROM FOO</check-valid-connection-sql>
</local-tx-datasource>
</datasources>
JDBC DataSource resource configuration options are described later in this section. Note, however, that the accessToUnderlyingConnectionAllowed configuration parameter must be set to "true".
- Deploy the servlet DDXQServlet.ear by copying it into JBoss_home/server/server_config/deploy.
- Start JBoss.
- Open your Web browser and point it to:
http://myserver:8080/DDXQServlet/
JBoss JDBC DataSource Resource Configuration Options
JBoss supports different type of JDBC DataSource resources. With DataDirect XQuery, you must use either no-tx-datasource or local-tx-datasource. The following table describes settings that are specific to DataDirect XQuery®. Refer to your JBoss documentation for details.
Parameter | Description |
user-name | User name to log on the database. |
password | Password to log on the database. |
connection-url | Connection URL. |
driver-class | Must be com.ddtek.xquery3.jdbc.XQueryDriver. |
new-connection-sql | Cannot be set; if set it is ignored. In order to set an initialization string, use the appropriate DataDirect XQuery connection property. |
track-statements | No statements are tracked. |
prepared-statement-cache-size | Should not be used in the context of DataDirect XQuery. Use DataDirect XQuery’s query pooling to maximize performance. |
transaction-isolation | Cannot be set. In order to change the default transaction isolation use the appropriate DataDirect XQuery connection property. |
Example
See the Example: JDBC Connection Pooling Servlet for an example of implementing a JDBC connection pool in DataDirect XQuery®.