Using Apache Derby with the J2EE SDK
Derby is an Open Source project based on the IBM contribution of the Cloudscape RDBMS to Apache. Cloudscape 10 and Derby are currently identical with the exception of what is packaged in the two products for extras.
If you download Cloudscape 10, it includes the DB2 JDBC Universal Driver which is needed for the Cloudscape/Derby Network Server. If you download Derby, you will need to download the DB2 JDBC Universal Driver seperately.
Installing the needed Derby/Cloudscape jar files
To use Derby/Cloudscape, copy the following jar files to $J2EE_HOME/domains/domain1/lib/ext and reboot the J2EE SDK:
For the DB2 Universal Driver:
For the Derby Embedded Driver:
Creating Derby Connection Pools
You can use either the DB2 JDBC Universal Driver or the Derby Embedded Driver when you create your Connection Pools. If you require XA support, currently you must use the Derby Embedded Driver. The work for the Derby Network Server to Support XA is underway, but not yet complete. If you must use the Application Client Container as well as other J2EE containers to access the same database, you need to use the DB2 JDBC Universal Driver and the Derby Network Server.
To create a connection Pool using the DB2 JDBC Universal Driver for Derby, you would specify the following values for your connection pool:
- portNumber=1527 (default port for the Network Server)
To create a connection pool using the Derby Embedded driver, you would need to specify the following values for your connection pool:
- databaseName (path to your Derby Database)
Using Derby/Cloudscape with the J2EE SDK CMP container
Currently the J2EE SDK CMP container does not know about Derby/Cloudscape. However Most EJBQL queries work fine and by creating a file called .tpersistence.properties in $J2EE_HOME/domains/domain1/config you will have even
The entries in the .tpersistence.properties file for Derby are:
Derby is a powerful Open Source Database which I think you will find works quite well with the J2EE SDK