com.sibvisions.rad.persist.jdbc
Class MSSQLDBAccess

java.lang.Object
  extended by com.sibvisions.rad.persist.jdbc.DBAccess
      extended by com.sibvisions.rad.persist.jdbc.MSSQLDBAccess
All Implemented Interfaces:
IDBAccess, ICloseable

public class MSSQLDBAccess
extends DBAccess

The MSSQLDBAccess is the implementation for MS SQL databases.

See Also:
DBAccess

Nested Class Summary
 
Nested classes/interfaces inherited from class com.sibvisions.rad.persist.jdbc.DBAccess
DBAccess.BlobFileHandle, DBAccess.ParameterizedStatement
 
Field Summary
 
Fields inherited from class com.sibvisions.rad.persist.jdbc.DBAccess
BFILE, LONGNVARCHAR, NCHAR, NCLOB, NVARCHAR, QUOTE, SQLXML, TIMESTAMPWITHLOCALTIMEZONE, TIMESTAMPWITHTIMEZONE
 
Constructor Summary
MSSQLDBAccess()
          Constructs a new MSSQLDBAccess Object.
 
Method Summary
protected  java.util.Map<java.lang.String,java.lang.Object[]> getAllowedValuesIntern(java.lang.String pCatalog, java.lang.String pSchema, java.lang.String pTable)
          Gets the allowed values from a specific table.
protected  java.lang.String getTableForSynonymIntern(java.lang.String pSynomyn)
          Returns the full qualified table name incl. schema/catalog/db link for the given synonym.
protected  TableInfo getTableInfoIntern(java.lang.String pWriteBackTable)
          Returns the meta data information for the specified query, and configures all columns with defaults.
 java.lang.Object[] insertDatabaseSpecific(java.lang.String pWritebackTable, java.lang.String pInsertStatement, ServerMetaData pServerMetaData, java.lang.Object[] pNewDataRow, java.lang.String pDummyColumn)
          Returns the newly inserted row from a Database specific insert statement.
 boolean isAutoQuote(java.lang.String pName)
          It returns true if this name should be automated quoted.
 void setUsername(java.lang.String pUsername)
          Sets the user name to connect with.
 
Methods inherited from class com.sibvisions.rad.persist.jdbc.DBAccess
clearMetaData, clearMetaData, close, commit, commitOrRollbackBeforeClose, convertDatabaseSpecificObjectToValue, convertValueToDatabaseSpecificObject, createIdentifier, createReplace, createServerColumnMetaData, createWhereColumn, createWhereParam, debug, delete, detectModified, error, eventConfigureConnection, eventUnconfigureConnection, executeFunction, executeFunction, executeProcedure, executeQuery, executeSql, executeSqlMulti, executeStatement, fetch, fetch, fetch, fetch, findAndCreateReducedCondition, findNamedParameters, fireEventConfigureConnection, fireEventUnconfigureConnection, formatSQLException, formatSQLException, getAllowedValues, getAutomaticLinkColumnNameTranslation, getCloseQuoteCharacter, getColumnMetaData, getColumnMetaDataCreator, getColumnMetaDataIntern, getColumnName, getConnection, getConnectionIntern, getConnectionPool, getDatabaseSpecificLockStatement, getDBAccess, getDBAccess, getDBAccess, getDBAccess, getDBAccess, getDBProperties, getDBProperty, getDefaultAllowedValues, getDefaultCursorCacheTimeout, getDefaultLargeObjectLimit, getDefaultSchema, getDefaultValues, getDefaultValuesIntern, getDiscardRowCount, getDriver, getForeignKeys, getForeignKeysIntern, getIdentifier, getLargeObjectLimit, getMaxColumnLength, getMaxTime, getMetaDataCacheOption, getMetaDataWhereClause, getObjectFromResultSet, getObjectFromResultSet, getOpenQuoteCharacter, getParameter, getParameter, getParameterizedSelectStatement, getPassword, getPreparedStatement, getPreparedStatement, getPrimaryKey, getPrimaryKeyIntern, getQueryTimeout, getRealQueryColumnName, getSelectStatement, getSelectStatement, getSQL, getTableForSynonym, getTableInfo, getTransactionTimeout, getUniqueKeys, getUniqueKeysIntern, getUrl, getUsername, getWhereClause, info, initializeColumnMetaData, initializeDataType, initializeServerColumnMetaData, insert, insertAnsiSQL, isAutoCommit, isConnectionPoolEnabled, isJdbc, isLogEnabled, isMetaDataCacheEnabled, isModified, isOpen, isReleaseConnectionPending, isTypeEqual, lockRow, lockRowInternal, open, prepareConnection, quote, quoteAllways, registerDBAccessClass, releaseConnection, releaseConnectionIntern, removeDBSpecificQuotes, removeQuotes, rollback, setAutoCommit, setAutomaticLinkColumnNameTranslation, setColumnMetaDataCreator, setColumnMetaDataCreator, setColumnsToStore, setConnection, setConnectionPool, setConnectionPoolEnabled, setDBProperties, setDBProperty, setDefaultCursorCacheTimeout, setDefaultLargeObjectLimit, setDefaultSchema, setDriver, setLargeObjectLimit, setMaxTime, setMetaDataCacheOption, setModified, setPassword, setQueryTimeout, setQuoteCharacters, setTransactionTimeout, setUrl, splitSchemaTable, supportsGetGeneratedKeys, toString, translateDefaultValue, translateQuotes, translateValue, update, updateAnsiSQL, updateDatabaseSpecific
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MSSQLDBAccess

public MSSQLDBAccess()
Constructs a new MSSQLDBAccess Object.

Method Detail

insertDatabaseSpecific

public java.lang.Object[] insertDatabaseSpecific(java.lang.String pWritebackTable,
                                                 java.lang.String pInsertStatement,
                                                 ServerMetaData pServerMetaData,
                                                 java.lang.Object[] pNewDataRow,
                                                 java.lang.String pDummyColumn)
                                          throws DataSourceException
Returns the newly inserted row from a Database specific insert statement.
Database specific derivations of DBAccess need to implement it database specific.

Overrides:
insertDatabaseSpecific in class DBAccess
Parameters:
pWritebackTable - the table to use for the insert
pInsertStatement - the SQL Statement to use for the insert
pServerMetaData - the meta data to use.
pNewDataRow - the new row (Object[]) with the values to insert
pDummyColumn - null, if all writeable columns are null, but for a correct INSERT it have to be minimum one column to use in the syntax.
Returns:
the newly inserted row from an Oracle Database.
Throws:
DataSourceException - if an Exception occur during insert to the storage

getAllowedValuesIntern

protected java.util.Map<java.lang.String,java.lang.Object[]> getAllowedValuesIntern(java.lang.String pCatalog,
                                                                                    java.lang.String pSchema,
                                                                                    java.lang.String pTable)
                                                                             throws DataSourceException
Gets the allowed values from a specific table. The allowed values are defined through check constraints or other table related restrictions.

Overrides:
getAllowedValuesIntern in class DBAccess
Parameters:
pCatalog - the catalog name
pSchema - the schema name
pTable - the table to check
Returns:
a Hashtable with a column name as key and the allowed values as array of Objects or null if there are no allowed values
Throws:
DataSourceException - if the database access throws an exception

isAutoQuote

public boolean isAutoQuote(java.lang.String pName)
Description copied from class: DBAccess
It returns true if this name should be automated quoted. e.g. in Oracle default all isUppercase(), so if the name has one loweCase character, then AutoQuote is true to quote this name.

Overrides:
isAutoQuote in class DBAccess
Parameters:
pName - the name to quote.
Returns:
true if this name should be automated quoted.

setUsername

public void setUsername(java.lang.String pUsername)
Description copied from class: DBAccess
Sets the user name to connect with.

Overrides:
setUsername in class DBAccess
Parameters:
pUsername - the user name

getTableInfoIntern

protected TableInfo getTableInfoIntern(java.lang.String pWriteBackTable)
                                throws DataSourceException
Returns the meta data information for the specified query, and configures all columns with defaults.

Overrides:
getTableInfoIntern in class DBAccess
Parameters:
pWriteBackTable - the write back table to use for the isWriteable() state (Optional)
Returns:
the meta data for the specified query, and initials all columns.
Throws:
DataSourceException - if an Exception occur during getting the meta data or if the storage is not opened or if one columns SQL type is not supported

getTableForSynonymIntern

protected java.lang.String getTableForSynonymIntern(java.lang.String pSynomyn)
                                             throws DataSourceException
Returns the full qualified table name incl. schema/catalog/db link for the given synonym. If pSynomyn is no synonym, then the pSynomyn string is returned.

Overrides:
getTableForSynonymIntern in class DBAccess
Parameters:
pSynomyn - the synonym to use.
Returns:
the full qualified table name incl. schema/catalog/db link for the given synonym.
Throws:
DataSourceException - if an error occur in determining the synonyms.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.