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


This is version 28. It is not the current version, and thus it cannot be edited.
[Back to current version]   [Restore this version]


The following instructions explain how to configure AppFuse so that the applications it generates will work with an Oracle database.
  1. 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 USER APPFUSE IDENTIFIED BY APPFUSE;  
GRANT CONNECT TO APPFUSE;
GRANT RESOURCE TO APPFUSE;
  1. Obtain the Oracle JDBC driver appropriate for your database and JDK version. (Oracle's license agreement will be shown just be downloading, make sure you read and understand it.)
    NOTE: According to the Oracle JDBC Driver README , classes12.jar is for JDK1.2 & 1.3, ojdbc14.jar is for JDK 1.4. The instructions here assume you will be using ojdbc14.jar, modify the instructions below accordingly if otherwise.
  2. In your {AppFuse home}/lib directory, add an "oracle" directory and place the ojdbc14.jar in it.
  3. 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:
  • 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.
  • 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.
    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):
database.jar=${lib.dir}/oracle/ojdbc14.jar


database.type=oracle
database.name=appfuse
database.host=localhost
#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

hibernate.dialect=net.sf.hibernate.dialect.Oracle9Dialect
database.driver_class=oracle.jdbc.driver.OracleDriver
database.url=jdbc:oracle:thin:@localhost:1521:myDB
database.username=appfuse
database.password=appfuse
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.
  1. Run "ant new -Dapp.name=myappname -Ddb.name=appfuse" as normal to generate your new web application directory.
  2. Reconfigure the build.properties file in the new "myappname" directory, following the instructions above. You will either need to update a few of the elements or all of them, depending on whether or not you decided to modify the main build.properties in the AppFuse distribution.
  3. Run "ant setup" within your new web app directory to compile and deploy your new application on Tomcat.
  4. Start tomcat and bring up the application: http://localhost:8080/myappname
    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. It is very difficult to turn off the Oracle container (I was not successful in doing so.) If you run into this problem, you may wish to shut off the Oracle instance, start Tomcat (so it will occupy port 8080), and then restart the Oracle database.
  5. 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:
select username, country from app_user;  
If everything is working correctly, you should see that the country value has changed for the profile that you edited.



Go to top   More info...   Attach file...
This particular version was published on 06-Nov-2006 13:52:46 MST by GlenMazza.