net.sf.colle.sql.mssql
Class MSSQLRuntime

java.lang.Object
  extended bynet.sf.colle.sql.schema.RDBMSRuntime
      extended bynet.sf.colle.sql.mssql.MSSQLRuntime

public class MSSQLRuntime
extends RDBMSRuntime

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

Version:
$Revision: 1.6 $, $Date: 2004/07/10 03:53:37 $
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
MSSQLRuntime()
           
 
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.
 String getDatabaseURL(String psServer, String psDatabase, Integer pnPort)
          Forms a DBMS specific database URL from the information provided.
 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().
 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, getInstance, getTruncName, 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

MSSQLRuntime

public MSSQLRuntime()
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

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)
Description copied from class: RDBMSRuntime
Drop the sequence from the database.

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

createSequence

public void createSequence(String psSequenceName,
                           int pnStartWith,
                           int pnIncrementBy,
                           Connection pxConnection)
Description copied from class: RDBMSRuntime
Create a new sequence.

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

getNextValue

public int getNextValue(String psSequenceName,
                        Connection pxConnection)
Description copied from class: RDBMSRuntime
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
See Also:
RDBMSRuntime

getDatabaseURL

public String getDatabaseURL(String psServer,
                             String psDatabase,
                             Integer pnPort)
Description copied from class: RDBMSRuntime
Forms a DBMS specific database URL from the information provided. If the net.sf.colle.sql.ConnectionManager.databaseURL system property is defined this method will not be called.

Overrides:
getDatabaseURL in class RDBMSRuntime
Parameters:
psServer - IP address or computer name of the server. Will not be null.
psDatabase - name of the database. May be null if the application does not define.
pnPort - port number of the server. May be null if the application does not define.
See Also:
RDBMSRuntime