To create the user account:
Start the SQL*Plus utility.
Log in to the database administrator account.
By default, system and manager are the username and
password for the database administrator, but you might have to ask
your Oracle system administrator to create the user for you if you do
not have the appropriate privileges.
In SQL*Plus, enter:
create user BC4J identified by BC4J;
On successful execution, SQL*Plus will respond with "User Created."
Next, enter:
grant resource,connect to BC4J;
On successful execution, SQL*Plus will respond with "Grant succeeded."
Note that certain Java2 style permissions must be granted to users
running business components in JServer. For example, the following
SQL script grants these permissions to the user BC4J (note that BC4J
must be uppercase):
SET VERIFY OFF;
EXEC
DBMS_JAVA.GRANT_PERMISSION('BC4J',
'SYS:java.util.PropertyPermission', '*', 'write');
EXEC
DBMS_JAVA.GRANT_PERMISSION('BC4J',
'SYS:java.util.PropertyPermission', '*', 'read');
EXEC
DBMS_JAVA.GRANT_PERMISSION('BC4J', 'SYS:java.lang.RuntimePermission',
'createClassLoader', null);
EXEC
DBMS_JAVA.GRANT_PERMISSION('BC4J', 'SYS:java.lang.RuntimePermission',
'setContextClassLoader', null);
COMMIT;
SET VERIFY ON;
EXIT;
To create and populate the database tables:
Again in SQL*Plus, connect to the newly created user account:
connect BC4J/BC4J@localhost
This assumes your database is you local machine. If it isn't, replace localhost
with the name of your database.
Locate the file OnlineOrders.sql in the OracleHome/Apache/BC4J/samples/onlineorders/sql_install directory and execute a command in SQL*Plus similar to the following:
@"C:/OracleHome/Apache/BC4J/samples/onlineorders/sql_install/OnlineOrders.sql"
To exit SQL*Plus, at the prompt enter: exit