net.sf.colle.sql.oracle
Class OracleRuntime

java.lang.Object
  extended bynet.sf.colle.sql.schema.RDBMSRuntime
      extended bynet.sf.colle.sql.oracle.OracleRuntime

public class OracleRuntime
extends RDBMSRuntime

Implementation of known differences in the Oracle RDBMS system. Created: 22 Feb 2001

Version:
$Revision: 1.8 $, $Date: 2004/09/13 05:03:22 $
Author:
Dwayne Schultz

Field Summary
 
Fields inherited from class net.sf.colle.sql.schema.RDBMSRuntime
ERROR_CONSTRAINT_VIOLATED, ERROR_DUPLICATE_ROW, ERROR_UNKNOWN
 
Constructor Summary
OracleRuntime()
           
 
Method Summary
 void createSequence(String psSequenceName, int pnStartWith, int pnIncrementBy, Connection pxConnection)
          Create a new sequence.
 void dropSequence(String psSequenceName, Connection pxConnection)
          Drop the sequence from the database.
 int getErrorCode(SQLException pxException)
          Return error code (ERROR_*) for SQLException.
 int getNextValue(String psSequenceName, Connection pxConnection)
          Request a unique identifier for the following sequence name.
 ResultSet getTables(String psTable, Connection pxConnection)
          Wraps calls to DatabaseMetaData.getTables().
 String getTruncName(String psName)
          Truncate a name value to a maximum size for a specific database.
 void loadCSVFile(Table pxTable, String psCSVFile, Connection pxConnection)
          Loads a CSV file into a table.
 String mapJDBCType(String psJDBCType, int pnLength, boolean pbNullable)
          Re-maps JDBC data types to vendor specific data types.
 
Methods inherited from class net.sf.colle.sql.schema.RDBMSRuntime
getCreatTableSuffix, getDatabaseURL, getInstance, isIndexRequiredOnForeignKey, lockTable, lockTables, unlockTable, unlockTables
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OracleRuntime

public OracleRuntime()
Method Detail

getErrorCode

public int getErrorCode(SQLException pxException)
Description copied from class: RDBMSRuntime
Return error code (ERROR_*) for SQLException.

Specified by:
getErrorCode in class RDBMSRuntime
Parameters:
pxException - SQL Exception
Returns:
Code of the error
See Also:
RDBMSRuntime

getTruncName

public String getTruncName(String psName)
Description copied from class: RDBMSRuntime
Truncate a name value to a maximum size for a specific database.

Overrides:
getTruncName in class RDBMSRuntime
Parameters:
psName - name to be truncated
Returns:
truncated name
See Also:
RDBMSRuntime

getTables

public ResultSet getTables(String psTable,
                           Connection pxConnection)
                    throws SQLException
Description copied from class: RDBMSRuntime
Wraps calls to DatabaseMetaData.getTables().

Specified by:
getTables in class RDBMSRuntime
Throws:
SQLException
See Also:
RDBMSRuntime

loadCSVFile

public void loadCSVFile(Table pxTable,
                        String psCSVFile,
                        Connection pxConnection)
Description copied from class: RDBMSRuntime
Loads a CSV file into a table.

Specified by:
loadCSVFile in class RDBMSRuntime
See Also:
RDBMSRuntime

mapJDBCType

public String mapJDBCType(String psJDBCType,
                          int pnLength,
                          boolean pbNullable)
Description copied from class: RDBMSRuntime
Re-maps JDBC data types to vendor specific data types.

Overrides:
mapJDBCType in class RDBMSRuntime
See Also:
RDBMSRuntime

dropSequence

public void dropSequence(String psSequenceName,
                         Connection pxConnection)
Drop the sequence from the database.

Specified by:
dropSequence in class RDBMSRuntime
Parameters:
psSequenceName - name to sequence
pxConnection - database connection

createSequence

public void createSequence(String psSequenceName,
                           int pnStartWith,
                           int pnIncrementBy,
                           Connection pxConnection)
Create a new sequence.

Specified by:
createSequence in class RDBMSRuntime
Parameters:
pnStartWith - starting value of the sequence
pnIncrementBy - increment by
pxConnection - database connection
psSequenceName - name to sequence

getNextValue

public int getNextValue(String psSequenceName,
                        Connection pxConnection)
Request a unique identifier for the following sequence name.

Specified by:
getNextValue in class RDBMSRuntime
Parameters:
psSequenceName - name to sequence
pxConnection - database connection
Returns:
return the next value in the sequence