Use the New Database Connection wizard or the Database Connection
page to create a JDBC connection to Derby.
The following JDBC drivers are supported for Derby:
- Derby Embedded JDBC Driver
- DB2® Universal
Driver
The Derby Embedded JDBC Driver is included with the Derby product.
You can download Derby and this driver from http://incubator.apache.org/derby/
The
derby.jar file is included with this product, in the com.ibm.datatools.db2.cloudscape
plug-in.
A sample Derby database is included in this
product. A connection to this database is visible in the Database Explorer
in the Connections folder. The connection name is SAMPLE[Derby 10.0].
To
connect to Derby using the DB2 Universal Driver, you must set up the server to accept
the connection by completing the following steps:
- Launch the Derby network server by running the following batch file: DERBY_INSTALL\frameworks\NetworkServer\bin\startNetworkServer.bat
- Type the following commands from the Derby install directory:
- set CLASSPATH=derby.jar;derbynet.jar
- java org.apache.derby.drda.NetworkServerControl start
If the network server is not on the computer that you are working
on, you must use the -h option to specify which IP range is allowed to establish
a connection. For example:
java org.apache.derby.drda.NetworkServerControl start -h 0.0.0.0
To connect to Derby databases, specify the following information.
Other fields should be filled in as described in the pop-up help.
- Database location
Type the absolute directory path to where Derby data is stored on your
file system.
- Create the database if required
- Select to create a new Derby database.
- Class location
For Derby connections using the Derby Embedded JDBC Driver: %DBHOME%\derby.jar
where %DBHOME% is the full directory path where the database manager
is installed.
For Derby connections using the DB2 Universal Driver: %DBHOME%\lib\db2jcc_license_c.jar and %DBHOME%\lib\db2jcc.jar in order
where %DBHOME% is
the full directory path where the database manager is installed.
- User ID and Password
- For Derby connections using the DB2 Universal Driver, you must enter a user
ID and password whether or not your database uses authentication. You can
enter any value in these fields.