Raible's Wiki

Raible Designs
Wiki Home
News
Recent Changes

AppFuse

Homepage
  - Korean
  - Chinese
  - Italian
  - Japanese

QuickStart Guide
  - Chinese
  - French
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish
  - Japanese

User Guide
  - Korean
  - Chinese

Tutorials
  - Chinese
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish

FAQ
  - Korean

Latest Downloads

Other Applications

Struts Resume
Security Example
Struts Menu

Set your name in
UserPreferences


Referenced by
AppFuseSupport
Articles
Articles_cn
Articles_de
Articles_pt
Articles_zh
IntegratingJBPMIntoA...
StrutsResumeSupport




JSPWiki v2.2.33

[RSS]


Hide Menu

RunningOnOracle


Difference between version 50 and version 32:

At line 1 changed 1 line.
The following instructions describe the steps required to configure AppFuse so that the applications it generates will work with an Oracle database.
The following instructions describe the steps needed to configure AppFuse so that the applications it generates will work with an Oracle database.
At line 6 changed 1 line.
* [3] Edit build.properties in the main AppFuse Directory (optional)
* [3] Edit build.properties in the main AppFuse Directory
At line 13 changed 1 line.
Create the Oracle Database schema account that will hold the default application tables. This can be done by your Oracle DBA. (You can choose a different user/schema name and password, just modify the subsequent instructions accordingly.)
Create the Oracle Database schema account that will hold your application's tables. This value should correspond to the {{-Ddb.name}} you use when running the __ant new__ task.
At line 16 changed 3 lines.
CREATE USER APPFUSE IDENTIFIED BY APPFUSE;
GRANT CONNECT TO APPFUSE;
GRANT RESOURCE TO APPFUSE;
CREATE USER <database-schema-owner> IDENTIFIED BY <password>;
GRANT CONNECT TO <database-schema-owner>;
GRANT RESOURCE TO <database-schema-owner>;
At line 30 changed 1 line.
!!Edit build.properties in the main AppFuse Directory (optional) [#3]
!!Edit build.properties in the main AppFuse Directory [#3]
At line 32 changed 1 line.
Next, the build.properties file needs to be updated to switch from a MySQL to an Oracle database. This can be done in two ways:
Next, the build.properties file needs to be updated to use an Oracle (instead of the default MySQL) database.
At line 34 changed 1 line.
* If most of your work is in Oracle, update the build.properties file in the AppFuse distribution. Most of its values will carry over to the build.properties file created within each app generated by AppFuse, so only a minor amount of editing of that second file will be necessary.
Here is a idea of what the database entries should look like for Oracle (modify the various fields as appropriate for your system):
At line 36 removed 3 lines.
* If most of your work is not in Oracle, you can ignore the build.properties file in the AppFuse distribution, and just edit the build.properties in the directory of the web app generated by AppFuse.<div> Whether you edit one or both files, here is a idea of what the database entries should look like for Oracle (modify the various fields as appropriate for your system):
<div style="margin: 10px">
At line 42 removed 1 line.
database.name=appfuse
At line 44 changed 4 lines.
#database URL for creating other databases (doesn't work with pgsql)
#database.admin.url=jdbc:${database.type}://${database.host}/template1
database.admin.username=appfuse
database.admin.password=appfuse
#use the database schema owner and password created in step #1 above here
database.username=username
database.password=password
database.schema=schemaname (case sensitive using 10g)
At line 49 changed 1 line.
hibernate.dialect=net.sf.hibernate.dialect.Oracle9Dialect
hibernate.dialect=org.hibernate.dialect.Oracle9Dialect
At line 51 changed 3 lines.
database.url=jdbc:oracle:thin:@localhost:1521:myDB
database.username=appfuse
database.password=appfuse
database.url=jdbc:oracle:thin:@localhost:1521:mySID
At line 56 changed 1 line.
<div class="note" style="margin: 10px">__NOTE:__ In the listings above, database.host should refer to the machine the Oracle database is running on. Also, database.url's "myDB" at the end should refer to the SERVICE_NAME within the tnsnames.ora database file on the database server machine.</div>
You'll also need to add the "database.schema" property to build.xml - in the &lt;dbunit&gt; tasks. For example:
At line 52 added 12 lines.
{{{
<dbunit driver="${database.driver_class}" schema="${database.schema}"
supportBatchStatement="false" url="${database.url}"
userid="${database.username}" password="${database.password}">
}}}
<div class="note" style="margin: 10px; background-color: #fcc">__WARNING:__ Avoid the use of "appfuse" as values for any of the parameters here. They may end up getting modified when you run the "ant new" task below.</div>
<div class="note" style="margin: 10px">__NOTE:__ In the listings above, {{database.host}} should refer to the machine the Oracle database is running on. Also, the "mySID" at the end of the {{database.url}} value should refer to the SERVICE_NAME within the tnsnames.ora database file on the database server machine.</div>
<div class="note" style="margin: 10px">__NOTE:__ There is also a {{database.name}} parameter available, but you should only add it to {{build.properties}} if you want to use a different database name than provided in the {{-Ddb.name}} parameter when you ran the __ant new__ task.</div>
At line 60 changed 1 line.
Run "ant new -Dapp.name=myappname -Ddb.name=appfuse" as normal to generate your new web application directory.
Run __ant new -Dapp.name={{myappname}} -Ddb.name={{mydbname}}__ as usual to generate the new web application directory.
At line 62 changed 1 line.
You will then need to reconfigure the build.properties file in the new "myappname" directory, following the instructions in [#3] above. You will either need to update a few of the elements or most of them, depending on whether or not you decided to modify the main build.properties in the AppFuse distribution.
For {{mydbname}}, use the schema owner name you created in Step #1 above.
At line 70 added 2 lines.
At line 67 changed 1 line.
Start tomcat and bring up the application: http://localhost:8080/myappname
Next, Start Tomcat and bring up the application: http://localhost:8080/myappname
At line 70 changed 1 line.
__NOTE:__ The Oracle database server may be configured to occupy port 8080 with its own servlet container. This may cause port conflicts if you are running Tomcat on the same machine. You may find it very difficult to turn off the Oracle container. If you run into this problem, you may wish to shut off the Oracle instance instead, start Tomcat (so it will occupy port 8080), and then restart the Oracle database.
__NOTE:__ The Oracle database server may be configured to occupy port 8080 with its own servlet container, which you may find very difficult to disable. This can cause port conflicts if you are running Tomcat on the same machine. If this problem occurs, it may be easiest to shut down the Oracle database, start Tomcat (so it will occupy port 8080), and then restart Oracle.
At line 75 changed 1 line.
# To test that database accesses are working properly, edit one of the profiles within the sample application and change the country listed. Then, within Oracle SQL*Plus, log in as "appfuse" user and issue this command:
To test that database accesses are working properly, edit one of the profiles within the sample application and change the country listed. Then, within Oracle SQL*Plus, log in as the schema owner and issue this command:

Back to RunningOnOracle, or to the Page History.