To create the user account:
1.
Start the SQL*Plus utility.
2.
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.
3.
In SQL*Plus, enter:
create user BC4J identified by BC4J;
On successful execution, SQL*Plus will respond with "User Created."
4.
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:
1.
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.
2.
Locate the file OnlineOrders.sql
in the OracleHome/Apache/BC4J/samples/onlineorders/DataBaseSetup
directory and execute a command in SQL*Plus similar to the following:
@"C:/OracleHome/Apache/BC4J/samples/onlineorders/DataBaseSetup/OnlineOrders.sql"
3. To exit SQL*Plus, at the prompt enter: exit
4. To config the oracle database URL address. The default connection is
“URL\=jdbc\\\:oracle\\\:thin\\\:@localhost\\\:1521\\\:ORCL\r”,
localhost: the Database server IP address(DNS name)
1521: Database Port number
ORCL: SID
1. If you want to change it, locating the connections.properties file under
OracleHome/Apache/Apache/htdocs/onlineorders_html then modify them.
Note:After you change the connections.properties file, you MUST restart the Apache web server.
2. Locating the ImageLoader.java at OracleHome/Apache/BC4J/samples/OnlineOrders/DatabaseSetup/Imageloader
then change the theDBURL on line 13 to the correct URL of database.
5. To load the images to database, locate the file DatabaseSetup.bat(DatabaseSetup.sh for Solaris) in the OracleHome/Apache/BC4J/samples directory, please run the DatabaseSetup.bat(DatabaseSetup.sh for Solaris) at:
"C:/OracleHome/Apache/BC4J/samples/DataBaseSetup.bat"