The initial installation of WebSphere Commerce Developer
provides WebSphere Commerce Developer with Apache Derby. You can reconfigure
your environment to use a DB2 database.
Before you begin
You should re-configure the development environment to use
an DB2 database if one or both of the following statements applies
to your environment:
- You are developing enterprise beans that require you to write
database specific SQL.
- You are making significant changes to the database schema
Ensure you have the following tasks completed:
- Install Rational Application Developer with the WebSphere Application
Server test environment.
- Install the latest fixes for Rational Application Developer
- Install the WebSphere Commerce Developer, including a test environment.
- Install a DB2 database on a local or remote Windows machine.
It is recommended that you use the latest DB2 fix pack.
See the
following table for a list of components required for a local or remote
installation of the DB2 database.
- Back up your existing Apache Derby development database. Refer
to your Apache Derby documentation for specific instructions.
About this task
When you specify a DB2 password, you should make sure
that it meets the naming restrictions for WebSphere Commerce databases.
If restricted characters are used in database passwords, you can encounter
connection errors when using utilities that take these passwords as
input on the command-line, including setdbtype.
For more information, see Troubleshooting: Database connection errors when utilities run from a command-line interface
Procedure
- Stop the Rational Application Developer server.
- If you are using a remote WebSphere Commerce development
database, complete one of the following actions:
- Start a Windows command prompt session.
- Change to the WCDE_installdir/bin directory.
- Depending on your needs, perform one of the following commands.
Option | Description |
---|
You are configuring the development environment to use a
newly created DB2 database. |
Issue the following command: setdbtype db2 DB2_HOME dbName dbAdminID dbAdminPassword dbUserID dbUserPassword [dbHost dbServerPort dbNode] createdb where:
- DB2_HOME
- The root directory of the DB2 or the DB2 client, depending on
if a local or remote database is being configured.
For example, c:\IBM\SQLLIB.
- dbName
- The name of the database you want to use with WebSphere Commerce
developer. If this is the first time you are switching databases,
enter the name you want to give the database that will be created
in the next step.
- dbAdminID
- The database administrator ID.
- dbAdminPassword
- The database administrator password.
- dbUserID
- The database user ID (schema owner).
- dbUserPassword
- The database user password.
- dbHost
- Remote database only The fully qualified host name of the
database server.
- dbServerPort
- Remote database only The port number on the database server
used for remote connections. The default port is 50000 for Windows.
- dbNode
- Remote database only The node name of the remote database.
You
can choose any name. The name will be used as a node name to catalog
the remote host
This command creates and populates the DB2 development
database and switches the development database to use this new database.For
example:
To create a new database on a local host, you would issue a
command similar to the following: setdbtype db2 c:\ibm\sqllib mall db2AdminID dbAdminPassword dbUserID dbUserPassword createdb
To create a new database on a remote host, you would issue
a command similar to the following: setdbtype db2 c:\ibm\sqllib mall db2AdminID dbAdminPassword dbUserID dbUserPassword vm3450 50000 node3450 createdb
|
You are configuring the development environment to use an
existing DB2 development database. |
Issue the following command: setdbtype db2 DB2_HOME dbName dbAdminID dbAdminPassword dbUserID dbUserPassword [dbHost dbServerPort dbNode] where:
- DB2_HOME
- The root directory of the DB2 or the DB2 client, depending on
if a local or remote database is being configured.
For example, c:\IBM\SQLLIB.
- dbName
- The name of the database you want to use with WebSphere Commerce
developer. If this is the first time you are switching databases,
enter the name of the existing database.
- dbAdminID
- The database administrator ID.
- dbAdminPassword
- The database administrator password.
- dbUserID
- The database user ID (schema owner).
- dbUserPassword
- The database user password.
- dbHost
- Remote database only The fully qualified host name of the
database server.
- dbServerPort
- Remote database only The port number on the database server
used for remote connections. The default port is 50000 for Windows.
- dbNode
- Remote database only The node name of the remote database.
You
can choose any name. The name will be used as a node name to catalog
the remote host
This command switches the development database to the
existing DB2 database.For example, to use an existing local database
you would issue a command similar to the following: setdbtype db2 c:\ibm\sqllib mall db2AdminID dbAdminPassword dbUserID dbUserPassword
|
- To reset the Stores project or before publishing a new
starter store, run the command:
- WCDE_installdir/bin/resetstores.bat
Note: If you run this command you will not be able to use the
existing stores if you decide to switch back to the Apache Derby database
at a later time.
- Re-enable any features you are using by
running feature enablement.
- Restart the WebSphere Commerce server.
Results
The WebSphere Commerce development environment is now configured
to use a DB2 database. All data in the Apache Derby database remains
unchanged until you return to using Apache Derby as the development
database. Your Apache Derby database is reset and cleaned if you do
any of the following:
- run the
resetdb.bat
command
- run the
resetstores.bat
command
- run the
setdbtype
command,
specifying Apache Derby and using the createdb
flag.