edu.ucsb.nceas.dbadapter
Class OracleAdapter

java.lang.Object
  |
  +--edu.ucsb.nceas.dbadapter.AbstractDatabase
        |
        +--edu.ucsb.nceas.dbadapter.OracleAdapter

public class OracleAdapter
extends AbstractDatabase

The Oracle db adapter implementation.


Constructor Summary
OracleAdapter()
           
 
Method Summary
 java.lang.String getDateTimeFunction()
          The Oracle's function name that gets the current date and time from the database server: "sysdate"
 java.lang.String getIsNULLFunction()
          The Oracle's function name that is used to return non-NULL value
 java.lang.String getStringDelimiter()
          The Oracles's string delimiter character: single quote (')
 long getUniqueID(java.sql.Connection conn, java.lang.String tableName)
          The Oracle unique ID generator through use of sequences The name of the sequence used to generate the unique id is made from the name of the table that uses the id by appending "_id_seq" to it.
 
Methods inherited from class edu.ucsb.nceas.dbadapter.AbstractDatabase
createObject, main
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OracleAdapter

public OracleAdapter()
Method Detail

getUniqueID

public long getUniqueID(java.sql.Connection conn,
                        java.lang.String tableName)
                 throws java.sql.SQLException
The Oracle unique ID generator through use of sequences The name of the sequence used to generate the unique id is made from the name of the table that uses the id by appending "_id_seq" to it. When record is inserted in the table and insert trigger gets a nextval from that sequence, select currval of that sequence can return the generated key in the same db connection.
Overrides:
getUniqueID in class AbstractDatabase
Parameters:
conn - db connection in which the unique id was generated
tableName - the name of table which unique id was generate
Returns:
return the generated unique id as a long type
Throws:
java.sql.SQLException -
any SQLException that can be thrown during the db operation

getDateTimeFunction

public java.lang.String getDateTimeFunction()
The Oracle's function name that gets the current date and time from the database server: "sysdate"
Overrides:
getDateTimeFunction in class AbstractDatabase
Returns:
return the current date and time function name: "sysdate"

getIsNULLFunction

public java.lang.String getIsNULLFunction()
The Oracle's function name that is used to return non-NULL value
Overrides:
getIsNULLFunction in class AbstractDatabase
Returns:
return the non-NULL function name: "nvl"

getStringDelimiter

public java.lang.String getStringDelimiter()
The Oracles's string delimiter character: single quote (')
Overrides:
getStringDelimiter in class AbstractDatabase
Returns:
return the string delimiter: single quote (')


Copyright © 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.