The Address Book example in OXF 2.2 illustrates the basics of the SQL
processor:

http://www.orbeon.com/oxf/examples/sql-ask-populate

The documentation only explains how to set it up with the bundled HSQL
Database Engine (HSQLDB). Here is how to set it up with Oracle:

1) Setup your datasource in your app server. Typically, for Tomcat,
add to your context in server.xml:

<Resource name="jdbc/db" auth="Container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/db">
    <parameter>
      <name>username</name>
      <value>scott</value>
    </parameter>
    <parameter>
      <name>password</name>
      <value>tiger</value>
    </parameter>
    <parameter>
      <name>driverClassName</name>
      <value>oracle.jdbc.driver.OracleDriver</value>
    </parameter>
    <parameter>
      <name>url</name>
      <value>jdbc:oracle:oci:@rosaura</value>
    </parameter>
</ResourceParams>

You will have to modify your username, password and JDBC URL according
to your local setup.

2) Run the following script in Oracle:

create table friends (
id number(9) not null,
first varchar2(240),
last varchar2(240),
phone varchar2(240));

create sequence friends_seq start with 1000 increment by 1 cache 10 nomaxvalue;

create or replace trigger friends_trigger
  before insert or update on friends for each row
begin
  select friends_seq.nextval into :NEW.id from dual;
end;
/

You should now be able to run the Address Book example in Oracle.

-Erik

_______________________________________________
oxf-users mailing list
[EMAIL PROTECTED]
http://mail.orbeon.com/mailman/listinfo/oxf-users

Reply via email to