1. Overview of GlassFish Server Administration
Default Settings and Locations
Instructions for Administering GlassFish Server
4. Administering the Virtual Machine for the Java Platform
6. Administering Web Applications
7. Administering the Logging Service
8. Administering the Monitoring Service
9. Writing and Running JavaScript Clients to Monitor GlassFish Server
10. Administering Life Cycle Modules
11. Extending and Updating GlassFish Server
Part II Resources and Services Administration
12. Administering Database Connectivity
To Install the Database and Database Driver
To Configure Your Environment to Run Java DB Utility Scripts
Configuring Access to the Database
Administering JDBC Connection Pools
To Create a JDBC Connection Pool
To Contact (Ping) a Connection Pool
To Reset (Flush) a Connection Pool
To Update a JDBC Connection Pool
To Delete a JDBC Connection Pool
Configuring Specific JDBC Connection Pool Features
Enabling the jdbc/__default Resource in a Clustered Environment
To Enable the jdbc/__default Resource for a Clustered Environment
Making the JDBC Driver JAR Files Accessible
Automatic Detection of Installed Drivers
Configuration Specifics for JDBC Drivers
IBM DB2 Database Type 2 Driver
IBM DB2 Database Type 4 Driver
MySQL Server Database Type 4 Driver
DataDirect Type 4 Driver for IBM DB2 Database
DataDirect Type 4 Driver for IBM Informix
DataDirect Type 4 Driver for Microsoft SQL Server Database
DataDirect Type 4 Driver for MySQL Server Database
DataDirect Type 4 Driver for Oracle 11 Database
DataDirect Type 4 Driver for Sybase Database
Inet Oraxo Driver for Oracle Database
Inet Merlia Driver for Microsoft SQL Server Database
13. Administering EIS Connectivity
14. Administering Internet Connectivity
15. Administering the Object Request Broker (ORB)
16. Administering the JavaMail Service
17. Administering the Java Message Service (JMS)
18. Administering the Java Naming and Directory Interface (JNDI) Service
19. Administering Transactions
GlassFish Server is designed to support connectivity to any database management system by using a corresponding JDBC driver. Configuration information is provided for these JDBC drivers:
The JAR files for the DB2 driver are db2jcc.jar, db2jcc_license_cu.jar, and db2java.zip. Set your environment variables . For example:
LD_LIBRARY_PATH=/usr/db2user/sqllib/lib:${Java EE.home}/lib DB2DIR=/opt/IBM/db2/V8.2 DB2INSTANCE=db2user INSTHOME=/usr/db2user VWSPATH=/usr/db2user/sqllib THREADS_FLAG=native
Configure the connection pool using the following settings:
Name: Use this name when you configure the JDBC resource later.
Resource Type: Specify the appropriate value.
Database Vendor: DB2
DataSource Classname: com.ibm.db2.jcc.DB2SimpleDataSource
Properties:
databaseName - Set as appropriate.
user – Set as appropriate.
password – Set as appropriate.
driverType – Set to 2.
deferPrepares – Set to false.
The JAR file for the DB2 driver is db2jcc.jar. Configure the connection pool using the following settings:
Name: Use this name when you configure the JDBC resource later.
Resource Type: Specify the appropriate value.
Database Vendor: DB2
DataSource Classname: com.ibm.db2.jcc.DB2SimpleDataSource
Properties:
databaseName - Set as appropriate.
user – Set as appropriate.
password – Set as appropriate.
driverType – Set to 4.
The Java DB/Derby JDBC driver is included with GlassFish Server by default, so you do not need to integrate this JDBC driver with GlassFish Server.
The JAR file for the Java DB driver is derbyclient.jar. (Java DB is based upon Apache Derby.) Configure the connection pool using the following settings:
Name: Use this name when you configure the JDBC resource later.
Resource Type: Specify the appropriate value.
Database Vendor: JavaDB
DataSource Classname: Specify one of the following:
org.apache.derby.jdbc.ClientDataSource40 org.apache.derby.jdbc.ClientXADataSource40
Properties:
serverName – Specify the host name or IP address of the database server.
portNumber – Specify the port number of the database server if it is different from the default.
databaseName – Specify the name of the database.
user - Specify the database user.
This is only necessary if Java DB is configured to use authentication. Java DB does not use authentication by default. When the user is provided, it is the name of the schema where the tables reside.
password – Specify the database password.
This is only necessary if Java DB is configured to use authentication.
The JAR file for the MySQL driver is mysql-connector-java-5.1.14-bin.jar. Configure the connection pool using the following settings:
Name: Use this name when you configure the JDBC resource later.
Resource Type: Specify the appropriate value.
Database Vendor: MySql
DataSource Classname:
com.mysql.jdbc.jdbc2.optional.MysqlDataSource com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
Properties:
serverName – Specify the host name or IP address of the database server.
portNumber – Specify the port number of the database server.
databaseName – Set as appropriate.
user – Set as appropriate.
password – Set as appropriate.
The JAR file for the Oracle 10 database driver is ojdbc14.jar. Make sure that the shared library is available through LD_LIBRARY_PATH and that the ORACLE_HOME property is set.
To make the Oracle driver behave in a Java EE-compliant manner, you must define the following JVM property:
-Doracle.jdbc.J2EE13Compliant=true
Configure the connection pool using the following settings:
Name: Use this name when you configure the JDBC resource later.
Resource Type: Specify the appropriate value.
Database Vendor: Oracle
DataSource Classname: Specify one of the following:
oracle.jdbc.pool.OracleDataSource oracle.jdbc.xa.client.OracleXADataSource
Properties:
user – Set as appropriate.
password – Set as appropriate.
The JAR file for the Oracle 11 database driver is ojdbc6.jar.
To make the Oracle driver behave in a Java EE-compliant manner, you must define the following JVM property:
-Doracle.jdbc.J2EE13Compliant=true
Configure the connection pool using the following settings:
Name: Use this name when you configure the JDBC resource later.
Resource Type: Specify the appropriate value.
Database Vendor: Oracle
DataSource Classname: Specify one of the following:
oracle.jdbc.pool.OracleDataSource oracle.jdbc.xa.client.OracleXADataSource
Properties:
user – Set as appropriate.
password – Set as appropriate.
Note - For this driver, the XAResource.recover method repeatedly returns the same set of in-doubt Xids regardless of the input flag. According to the XA specifications, the Transaction Manager initially calls this method with TMSTARTSCAN and then with TMNOFLAGS repeatedly until no Xids are returned. The XAResource.commit method also has some issues.
To disable this GlassFish Server workaround, the oracle-xa-recovery-workaround property value must be set to false.
Additionally, in order for the transaction manager to recover transactions, the JDBC connection pool's database user must be given certain Oracle permissions:
SELECT permission on DBA_PENDING_TRANSACTIONS, PENDING_TRANS$, DBA_2PC_PENDING and DBA_2PC_NEIGHBORS.
EXECUTE permissions on DBMS_XA and DBMS_SYSTEM.
The JAR file for the PostgreSQL driver is postgresql-9.0-801.jdbc4.jar. Configure the connection pool using the following settings:
Name: Use this name when you configure the JDBC resource later.
Resource Type: Specify the appropriate value.
Database Vendor: Postgresql
DataSource Classname: org.postgresql.ds.PGSimpleDataSource
Properties:
serverName – Specify the host name or IP address of the database server.
portNumber – Specify the port number of the database server.
databaseName – Set as appropriate.
user – Set as appropriate.
password – Set as appropriate.
The JAR file for DataDirect driver is db2.jar. Configure the connection pool using the following settings:
Name: Use this name when you configure the JDBC resource later.
Resource Type: Specify the appropriate value.
Database Vendor: DataDirect-DB2
DataSource Classname: com.ddtek.jdbcx.db2.DB2DataSource
Properties:
serverName – Specify the host name or IP address of the database server.
portNumber – Specify the port number of the database server.
databaseName – Set as appropriate.
user – Set as appropriate.
password – Set as appropriate.
Configure the connection pool using the following settings:
Name: Use this name when you configure the JDBC resource later.
Resource Type: Specify the appropriate value.
Database Vendor: DataDirect-Informix
DataSource Classname: Specify one of the following:
com.informix.jdbcx.IfxDataSource com.informix.jdbcx.IfxXADataSource
DataDirect DataSource Classname: com.ddtek.jdbcx.informix.InformixDataSourcee
Properties:
serverName – Specify the Informix database server name.
portNumber – Specify the port number of the database server.
databaseName – Set as appropriate. This is optional.
user – Set as appropriate.
password – Set as appropriate.
IfxIFXHost – Specify the host name or IP address of the database server.
The JAR file for the DataDirect driver is sqlserver.jar. Configure the connection pool using the following settings:
Name: Use this name when you configure the JDBC resource later.
Resource Type: Specify the appropriate value.
Database Vendor: DataDirect-Microsoft SQL Server
DataSource Classname: com.ddtek.jdbcx.sqlserver.SQLServerDataSource
Properties:
serverName – Specify the host name or IP address and the port of the database server.
portNumber – Specify the port number of the database server.
user – Set as appropriate.
password – Set as appropriate.
selectMethod – Set to cursor.
The JAR file for the DataDirect driver is mysql.jar. Configure the connection pool using the following settings:
Name: Use this name when you configure the JDBC resource later.
Resource Type: Specify the appropriate value.
Database Vendor: DataDirect-MySQL
DataSource: com.ddtek.jdbcx.mysql.MySQLDataSource
Properties:
serverName – Specify the host name or IP address and the port of the database server.
portNumber – Specify the port number of the database server.
user – Set as appropriate.
password – Set as appropriate.
selectMethod – Set to cursor.
The JAR file for the DataDirect driver is oracle.jar.
To make the Oracle driver behave in a Java EE-compliant manner, you must define the following JVM property:
-Doracle.jdbc.J2EE13Compliant=true
Configure the connection pool using the following settings:
Name: Use this name when you configure the JDBC resource later.
Resource Type: Specify the appropriate value.
Database Vendor: DataDirect-Oracle
DataSource Classname: com.ddtek.jdbcx.oracle.OracleDataSource
Properties:
serverName – Specify the host name or IP address of the database server.
portNumber – Specify the port number of the database server.
user – Set as appropriate.
password – Set as appropriate.
The JAR file for the DataDirect driver is sybase.jar. Configure the connection pool using the following settings:
Name: Use this name when you configure the JDBC resource later.
Resource Type: Specify the appropriate value.
Database Vendor: DataDirect-Sybase
DataSource Classname: com.ddtek.jdbcx.sybase.SybaseDataSource
Properties:
serverName – Specify the host name or IP address of the database server.
portNumber – Specify the port number of the database server.
databaseName – Set as appropriate. This is optional.
user – Set as appropriate.
password – Set as appropriate.
Note - In some situations, using this driver can cause exceptions to be thrown because the driver creates a stored procedure for every parameterized PreparedStatement by default. If this situation arises, add the property PrepareMethod, setting its value to direct.
The JAR file for the Inet Oracle driver is Oranxo.jar. Configure the connection pool using the following settings:
Name: Use this name when you configure the JDBC resource later.
Resource Type: Specify the appropriate value.
Database Vendor: Oracle
DataSource Classname: com.inet.ora.OraDataSource
Properties:
serverName – Specify the host name or IP address of the database server.
portNumber – Specify the port number of the database server.
user – Specify the database user.
password – Specify the database password.
serviceName – Specify the URL of the database. The syntax is as follows:
jdbc:inetora:server:port:dbname
For example:
jdbc:inetora:localhost:1521:payrolldb
In this example,localhost is the name of the host running the Oracle server, 1521 is the Oracle server’s port number, and payrolldb is the SID of the database. For more information about the syntax of the database URL, see the Oracle documentation.
streamstolob - If the size of BLOB or CLOB data types exceeds 4 KB and this driver is used for CMP, this property must be set to true.
The JAR file for the Inet Microsoft SQL Server driver is Merlia.jar. Configure the connection pool using the following settings:
Name: Use this name when you configure the JDBC resource later.
Resource Type: Specify the appropriate value.
Database Vendor: MicrosoftSqlServer
DataSource Classname: com.inet.tds.TdsDataSource
Properties:
serverName – Specify the host name or IP address and the port of the database server.
portNumber – Specify the port number of the database server.
user – Set as appropriate.
password – Set as appropriate.
The JAR file for the Inet Sybase driver is Sybelux.jar. Configure the connection pool using the following settings:
Name: Use this name when you configure the JDBC resource later.
Resource Type: Specify the appropriate value.
Database Vendor: Sybase
DataSource Classname: com.inet.syb.SybDataSource
Properties:
serverName – Specify the host name or IP address of the database server.
portNumber – Specify the port number of the database server.
databaseName – Set as appropriate. Do not specify the complete URL, only the database name.
user – Set as appropriate.
password – Set as appropriate.
The JAR file for the Sybase driver is jconn4.jar. Configure the connection pool using the following settings:
Name: Use this name when you configure the JDBC resource later.
Resource Type: Specify the appropriate value.
Database Vendor: Sybase
DataSource Classname: Specify one of the following:
com.sybase.jdbc4.jdbc.SybDataSource com.sybase.jdbc4.jdbc.SybXADataSource
Properties:
serverName – Specify the host name or IP address of the database server.
portNumber – Specify the port number of the database server.
databaseName – Set as appropriate. Do not specify the complete URL, only the database name.
user – Set as appropriate.
password – Set as appropriate.
BE_AS_JDBC_COMPLIANT_AS_POSSIBLE – Set to true.
FAKE_METADATA – Set to true.