|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sibvisions.rad.persist.jdbc.DBAccess
com.sibvisions.rad.persist.jdbc.MSSQLDBAccess
public class MSSQLDBAccess
The MSSQLDBAccess
is the implementation for MS SQL databases.
DBAccess
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.sibvisions.rad.persist.jdbc.DBAccess |
---|
DBAccess.ColumnMetaDataInfo |
Field Summary |
---|
Fields inherited from class com.sibvisions.rad.persist.jdbc.DBAccess |
---|
logger, LONGNVARCHAR, NCHAR, NCLOB, NVARCHAR, QUOTE, SQLXML |
Constructor Summary | |
---|---|
MSSQLDBAccess()
Constructs a new MSSQLDBAccess Object. |
Method Summary | |
---|---|
Hashtable<String,Object[]> |
getAllowedValues(String pCatalog,
String pSchema,
String pTable)
Gets the allowed values from a specific table. |
DBAccess.ColumnMetaDataInfo |
getColumnMetaData(String pFromClause,
String[] pQueryColumns,
String pBeforeQueryColumns,
String pWhereClause,
String pAfterWhereClause,
String pWritebackTable,
String[] pWritebackColumns)
Returns the meta data information for the specified query, and configures all columns with defaults. |
String |
getTableForSynonym(String pSynomyn)
Returns the full qualified table name incl. schema/catalog/db link for the given synonym. |
Object[] |
insertDatabaseSpecific(String pWritebackTable,
String pInsertStatement,
ServerMetaData pServerMetaData,
Object[] pNewDataRow,
String pDummyColumn)
Returns the newly inserted row from an Database specific insert statement. |
boolean |
isAutoQuote(String pName)
It returns true if this name should be automated quoted. |
void |
setUsername(String pUsername)
Sets the user name to connect with. |
protected Object |
translateDefaultValue(String pColumnName,
int pDataType,
String pDefaultValue)
Translates a default value from a column to the datatype object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MSSQLDBAccess()
Method Detail |
---|
public Object[] insertDatabaseSpecific(String pWritebackTable, String pInsertStatement, ServerMetaData pServerMetaData, Object[] pNewDataRow, String pDummyColumn) throws DataSourceException
insertDatabaseSpecific
in class DBAccess
pWritebackTable
- the table to use for the insertpInsertStatement
- the SQL Statement to use for the insertpServerMetaData
- the meta data to use.pNewDataRow
- the new row (Object[]) with the values to insertpDummyColumn
- null
, if all writeable columns are null, but for a correct INSERT it have
to be minimum one column to use in the syntax.
DataSourceException
- if an Exception
occur during insert to the storageprotected Object translateDefaultValue(String pColumnName, int pDataType, String pDefaultValue) throws Exception
translateDefaultValue
in class DBAccess
pColumnName
- the column name to translatepDataType
- the datatype of the columnpDefaultValue
- the original default value from the database
null
if the default value is not valid
Exception
- if the type translation causes an error or the datatype is not supportedpublic Hashtable<String,Object[]> getAllowedValues(String pCatalog, String pSchema, String pTable) throws DataSourceException
getAllowedValues
in class DBAccess
pCatalog
- the catalog namepSchema
- the schema namepTable
- the table to check
Hashtable
with a column name as key and the allowed values as array of Object
s or
null
if there are no allowed values
DataSourceException
- if the database access throws an exceptionpublic boolean isAutoQuote(String pName)
DBAccess
isAutoQuote
in class DBAccess
pName
- the name to quote.
public void setUsername(String pUsername)
DBAccess
setUsername
in class DBAccess
pUsername
- the user namepublic DBAccess.ColumnMetaDataInfo getColumnMetaData(String pFromClause, String[] pQueryColumns, String pBeforeQueryColumns, String pWhereClause, String pAfterWhereClause, String pWritebackTable, String[] pWritebackColumns) throws DataSourceException
DBAccess
getColumnMetaData
in class DBAccess
pFromClause
- the from clause with query tables and join definitionspQueryColumns
- the query columnspBeforeQueryColumns
- the before query columnspWhereClause
- the last where condition in querypAfterWhereClause
- the after where clause in querypWritebackTable
- the write back table to use for the isWriteable() state (Optional)pWritebackColumns
- the write back columns to use for the isWriteable() state (Optional)
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 supportedpublic String getTableForSynonym(String pSynomyn) throws DataSourceException
getTableForSynonym
in class DBAccess
pSynomyn
- the synonym to use.
DataSourceException
- if an error occur in determining the synonyms.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |