org.apache.cayenne.dba.sqlserver
Class SQLServerAdapter

java.lang.Object
  extended by org.apache.cayenne.dba.JdbcAdapter
      extended by org.apache.cayenne.dba.sybase.SybaseAdapter
          extended by org.apache.cayenne.dba.sqlserver.SQLServerAdapter
All Implemented Interfaces:
DbAdapter

public class SQLServerAdapter
extends SybaseAdapter

Cayenne DbAdapter implementation for engine.

Microsoft Driver Settings

Sample connection settings to use with MS SQL Server are shown below:

 
  
   
       sqlserver.cayenne.adapter = org.apache.cayenne.dba.sqlserver.SQLServerAdapter
       sqlserver.jdbc.username = test
       sqlserver.jdbc.password = secret
       sqlserver.jdbc.url = jdbc:microsoft:sqlserver://192.168.0.65;databaseName=cayenne;SelectMethod=cursor
       sqlserver.jdbc.driver = com.microsoft.jdbc.sqlserver.SQLServerDriver
 

Note on case-sensitive LIKE: if your application requires case-sensitive LIKE support, ask your DBA to configure the database to use a case-senstitive collation (one with "CS" in symbolic collation name instead of "CI", e.g. "SQL_Latin1_general_CP1_CS_AS").

jTDS Driver Settings

jTDS is an open source driver that can be downloaded from http://jtds.sourceforge.net . It supports both SQLServer and Sybase. Sample SQLServer settings are the following:

 
  
   
       sqlserver.cayenne.adapter = org.apache.cayenne.dba.sqlserver.SQLServerAdapter
       sqlserver.jdbc.username = test
       sqlserver.jdbc.password = secret
       sqlserver.jdbc.url = jdbc:jtds:sqlserver://192.168.0.65/cayenne
       sqlserver.jdbc.driver = net.sourceforge.jtds.jdbc.Driver
    
   
  
 

Since:
1.1
Author:
Andrei Adamchik

Field Summary
static java.lang.String TRIM_FUNCTION
           
 
Fields inherited from class org.apache.cayenne.dba.JdbcAdapter
extendedTypes, pkGenerator, supportsBatchUpdates, supportsFkConstraints, supportsGeneratedKeys, supportsUniqueConstraints, typesHandler
 
Constructor Summary
SQLServerAdapter()
           
 
Method Summary
protected  void createTableAppendColumn(java.lang.StringBuffer sqlBuffer, DbAttribute column)
          Overrides super implementation to correctly set up identity columns.
 SQLAction getAction(Query query, DataNode node)
          Uses SQLServerActionBuilder to create the right action.
 QualifierTranslator getQualifierTranslator(QueryAssembler queryAssembler)
          Returns a trimming translator.
 
Methods inherited from class org.apache.cayenne.dba.sybase.SybaseAdapter
bindParameter, configureExtendedTypes, createPkGenerator, getBatchTerminator
 
Methods inherited from class org.apache.cayenne.dba.JdbcAdapter
buildAttribute, createDataNode, createFkConstraint, createTable, createTableAppendPKClause, createUniqueConstraint, dropTable, externalTypesForJdbcType, findAdapterResource, getExtendedTypes, getPkGenerator, getQueryTranslator, queryTranslatorClass, setPkGenerator, setSupportsBatchUpdates, setSupportsFkConstraints, setSupportsGeneratedKeys, setSupportsUniqueConstraints, shouldRunBatchQuery, supportsBatchUpdates, supportsFkConstraints, supportsGeneratedKeys, supportsUniqueConstraints, tableTypeForTable, tableTypeForView
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRIM_FUNCTION

public static final java.lang.String TRIM_FUNCTION
See Also:
Constant Field Values
Constructor Detail

SQLServerAdapter

public SQLServerAdapter()
Method Detail

getAction

public SQLAction getAction(Query query,
                           DataNode node)
Uses SQLServerActionBuilder to create the right action.

Specified by:
getAction in interface DbAdapter
Overrides:
getAction in class JdbcAdapter
Since:
1.2

getQualifierTranslator

public QualifierTranslator getQualifierTranslator(QueryAssembler queryAssembler)
Returns a trimming translator.

Specified by:
getQualifierTranslator in interface DbAdapter
Overrides:
getQualifierTranslator in class JdbcAdapter

createTableAppendColumn

protected void createTableAppendColumn(java.lang.StringBuffer sqlBuffer,
                                       DbAttribute column)
Overrides super implementation to correctly set up identity columns.

Overrides:
createTableAppendColumn in class JdbcAdapter
Since:
1.2


Copyright © 2001-2006 Apache.org All Rights Reserved.