Oracle

Scarab has been developed with database independence in mind, however our primary goal is to make Scarab work with MySQL. Therefore, our support for other RDBM's is largely untested. We are relying on the user community in order to help us test and develop further support for other databases. This document outlines the steps that we think are required to get Scarab working with Oracle. Community feedback on this document will help improve things for others.

Basic instructions

In order to get Torque to generate the right Scarab .sql files for Oracle, try the following:

  • Copy the Oracle jdbc driver .jar file into the scarab/lib/ directory *before* building Scarab. If the jar is named to match the regular expression *oracle*.jar, the existing build process will copy it as necessary.
  • Create a scarab/build.properties file.
  • In it, fill out the following properties with the right information pertaining to Oracle...ie: for database.*.url, create an Oracle JDBC URL. For database.type, put 'oracle'. For jdbc.driver, put the Oracle one....then, rm the target directory and rebuild.
scarab.database.host=localhost
scarab.database.port=
scarab.database.url=
scarab.database.admin.url=
scarab.database.type=oracle
scarab.database.jdbc.driver=oracle.jdbc.driver.OracleDriver
scarab.database.username=
scarab.database.password=
scarab.database.admin.username=
scarab.database.admin.password=
scarab.database.validationQuery=SELECT 1 FROM DUAL
Note: Effective with version 1.0 beta 12, it is no longer necessary to add scarab.database.validationQuery to build.properties. It is automatically added when scarab.database.type is set to oracle.

There is also some more discussion and information in this reported issue.

Inconsistent Datatypes

BLOB
  java.lang.RuntimeException: Please check turbine.log for more info: Failed to retrieve users: ORA-00932: inconsistent datatypes
  at org.tigris.scarab.om.ScarabModule.getUsers(ScarabModule.java:164)
  at org.tigris.scarab.tools.ScarabRequestTool.getUsers(ScarabRequestTool.java:1856)

        (remainder of stack trace omitted)

A workaround is to edit the webapps/scarab/WEB-INF/sql/turbine.sql file, and change the columns defined as BLOB to VARCHAR2(4000).

An alternate workaround would be to edit webapps/scarab/WEB-INF/src/torque/templates/sql/base/oracle/db.props and change the line which reads


VARBINARY = BLOB

to be

VARBINARY = VARCHAR2(4000)

This has the slight advantage of being slightly more persistent - the only time that this file changes is when a new version of Torque is added into Scarab, or when "ant clean" or "ant clean-all" is run.