| Sun Java System Application Server |
The sample applications included in the Application Server are configured to work with the included Derby database server. For more information on using Derby with the samples see Using Derby with the Samples.
This document explains how to configure the samples environment to work with an Oracle database server.
Follow these steps to configure your environment to run sample applications with Oracle.
To add the Oracle JDBC driver to the application server classpath, do one of the following:
lib/
directory which is install_dir/domains/domain1/lib.
All the libraries in this directory are automatically added to the
server's classpath during restart.You must restart the application server to update the classpath.
If you are using a Type 2 driver, you must also
add oracle_home/lib
to the Native Library Path Suffix setting in the application
server instance's Application Server -> JVM Settings Tab ->
Path Settings page.
The following steps assume that you have access to a running Oracle RDBMS. Note: the user creation script will drop any existing users with the same name.
Use install_dir/samples/docs/cr_ora_user.sql
to create specific sample oracle user. This script will create the user
on the specified tablespace.
Start
For Java Petstore, use one of the following as both user_name and password:
For tablespace_name, if you want to create a separate tablespace for
all samples, use the Use When there is only one
Edit the file If the application has been deployed previously with a
Derby configuration, use these commands to build and deploy it: You need to restart the application server if the
application ran previously with Derby. If this is the first time the application has been
deployed, use these commands: Copyright © 2006 Sun Microsystems, Inc.
All rights reserved. sqlplus and login as system/manager.
Then type this command:
<SQL>
@cr_ora_user.sql user_name password tablespace_name
install_dir/samples/docs/cr_ora_tb.sql
script. If you don't want to create the new tablespace, issue the following
SQL command as system/manager to see the available online tablespaces:
select tablespace_name, status from DBA_TABLESPACES
sqlplus with the user created above and run the SQL script under
sample_app_dir/sql to load the database schema for this sample..sql file, it works with both Oracle and Derby.Modify the Database Properties File
install_dir/samples/database.properties
default.database property to the type of JDBC driver you are using.
Determine acceptable values by scanning the database.properties file.
An entry of the type ABC.host or ABC.port
implies that you can set default.database to ABC.
ABC.host, ABC.port
and ABC.dbname (sid of the database) are set correctly.Build and Deploy the Application
asant undeploy
asant deploy
asant core
asant deploy