Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: The JDBC driver is now configured in the main pom.xml file, hsqldb is always there for test purposes now so there is no need to edit uportal-impl/pom.xml any more. Removed references to PostgreSQL that didn't belong in "Oracle" documentation.

...

The groupId, artifactId and version specified in this command are up to you but they should match the JAR vendor, name and version to avoid confusion down the road.

Opening /uPortal/uportal-impl/pom.xml there is a section about 20 92 lines down that reads:

Code Block
xml
xml
<!-- ***** Portal JDBC Driver *****  | Add your<!-- The JDBC Driver dependencyused here.by IfuPortal you-->
are not using hsqldb you must change the scope <jdbc.groupId>hsqldb</jdbc.groupId>
 | to test instead of just removing it as the driver is required for unit tests.
 +-->
<dependency>
    <groupId>hsqldb</groupId> <jdbc.artifactId>hsqldb</jdbc.artifactId>
    <artifactId>hsqldb</artifactId>     <version>$<jdbc.version>${hsqldb.version}</version>
    <scope>compile</scope>
</dependency>jdbc.version>

We will add the Oracle driver here using the group, artifact and version information from the mvn install:install-file command above and do as the comment says and change the <scope> tag of the hsqldb driver to test.

Code Block
xml
xml
<!-- ***** Portal JDBC Driver *****  | Add your<!-- The JDBC Driver dependencyused here.by IfuPortal you-->
are not using hsqldb you must change the scope
 | to test instead of just removing it as the driver is required for unit tests.
 +-->
<dependency>
    <groupId>com.oracle</groupId> <jdbc.groupId>com.oracle</jdbc.groupId>
        <jdbc.artifactId>ojdbc14</jdbc.artifactId>
    <artifactId>ojdbc14</artifactId>     <version>10<jdbc.version>10.2.0.3.0</version>
</dependency>

<dependency>
    <groupId>hsqldb</groupId>
    <artifactId>hsqldb</artifactId>
    <version>${hsqldb.version}</version>
    <scope>test</scope>
</dependency>jdbc.version>

See Issues section about possible issues using this driver.

...

Testing The Configuration

Start Postgres and then in your portal development directory, issue the command:Running the dbtest ant target will tell you if you have configured the database connection properly.

Code Block
ant dbtest

If it works correct you should see something like

...

:

Code Block

     [java]     Connected To: jdbc:oracle:thin:@yourserver:1521:uportal
     [java]     Supports:
     [java]         Outer Joins:          true
     [java]         Transactions:         true
     [java]         {ts metasyntax:       true
     [java]         TO_DATE():            false

     [java] Database name:    'Oracle'
     [java] Database version: 'Oracle Database 11g Release 11.1.0.0.0 - Production'
     [java] Driver name:      'Oracle JDBC driver'
     [java] Driver version:   '10.2.0.3.0'
     [java] Driver class:     'Oracle JDBC driver'
     [java] Connection URL:   'jdbc:oracle:thin:@yourserver:1521:uportal'
     [java] User:             'USERNAME'

     [java] Type Mappings: [Type[genericType=TIMESTAMP,local=DATE]]

     [java] supportsANSI92EntryLevelSQL: true
     [java] supportsANSI92FullSQL:       false
     [java] supportsCoreSQLGrammar:     true
     [java] supportsExtendedSQLGrammar: true

     [java] supportsTransactions:         true
     [java] supportsMultipleTransactions: true
     [java] supportsOpenCursorsAcrossCommit:      false
     [java] supportsOpenCursorsAcrossRollback:    false
     [java] supportsOpenStatementsAcrossCommit:   false
     [java] supportsOpenStatementsAcrossRollback: false

     [java] supportsStoredProcedures:     true
     [java] supportsOuterJoins:           true
     [java] supportsFullOuterJoins:       true
     [java] supportsLimitedOuterJoins:    true
     [java] supportsBatchUpdates:         true
     [java] supportsColumnAliasing:       true
     [java] supportsExpressionsInOrderBy: true
     [java] supportsOrderByUnrelated:     true
     [java] supportsPositionedDelete:     false
     [java] supportsSelectForUpdate:      true
     [java] supportsUnion:                true
     [java] supportsUnionAll:             true

     [java] getMaxColumnNameLength: 30
     [java] getMaxColumnsInIndex:   32
     [java] getMaxColumnsInOrderBy: 0
     [java] getMaxColumnsInSelect:  0
     [java] getMaxColumnsInTable:   1000
     [java] getMaxConnections:      0
     [java] getMaxCursorNameLength: 0
     [java] getMaxIndexLength:      0
     [java] getMaxRowSize:          2000
     [java] getMaxStatements:       0
     [java] getMaxTableNameLength:  30
     [java] getMaxTablesInSelect:   0
     [java] getMaxUserNameLength:   30
     [java] getSearchStringEscape:  //
     [java] getStringFunctions:     ASCII,CHAR,CONCAT,LCASE,LENGTH,LTRIM,REPLACE,RTRIM,SOUNDEX,SUBSTRING,UCASE
     [java] getSystemFunctions:     USER
     [java] getTimeDateFunctions:   HOUR,MINUTE,SECOND,MONTH,YEAR

     [java] Table Types: SYNONYM,TABLE,VIEW
     [java] SQL Types:   INTERVALDS,INTERVALYM,TIMESTAMP WITH LOCAL TIME ZONE,TIMESTAMP WITH TIME ZONE,
NUMBER,NUMBER,NUMBER,LONG RAW,RAW,LONG,CHAR,NUMBER,NUMBER,NUMBER,FLOAT,REAL,VARCHAR2,DATE,DATE,
TIMESTAMP,STRUCT,ARRAY,BLOB,CLOB,REF

BUILD SUCCESSFUL

Edit /uPortal/uportal-impl/src/main/resources/properties/db/dbloader.xml and verify that there is an entry just like the database version you displayed in the last step:

Code Block
xml
xml
  <db-type-mapping>
    <db-name>PostgreSQL<name>Oracle</db-name>
    <db-version>7.4.5<version>Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit ProductionWith the Partitioning, OLAP and Data Mining options</db-version>
    <driver-name>PostgreSQLname>Oracle NativeJDBC Driver<driver</driver-name>
    <driver-version>PostgreSQL 7.4.5 JDBC3 with SSL (build 215)<version>10.2.0.3.0</driver-version>
    <type><generic>LONGVARCHAR<<type><generic>TIMESTAMP</generic><local>TEXT<generic><local>DATE</local></type>
    <type><generic>VARCHAR</generic><local>VARCHAR</local></type>
    <type><generic>LONGVARBINARY</generic><local>BYTEA</local></type>
    <type><generic>VARBINARY</generic><local>BYTEA</local></type>
    <type><generic>BLOB</generic><local>OID</local></type>
  <!-- map more types here -->
  </db-type-mapping>

If there is not an exact match, then add it.

...

Start your servlet container.

If you upgrade Postgres, you should update the referenced JAR in uportal-impl/pom.xml and update entries in dbloader.xml.

Loading the DatabaseLoading the Database

Tip
titleDatabase Privileges

uPortal 3 requires CREATE SEQUENCE privileges, previous versions of uPortal did not.

Loading the database requires a couple of steps

...