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:sqlserver://192.168.0.65;databaseName=cayenne;SelectMethod=cursor
       sqlserver.jdbc.driver = com.microsoft.sqlserver.jdbc.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

Field Summary
static String TRIM_FUNCTION
           
 
Fields inherited from class org.apache.cayenne.dba.JdbcAdapter
ejbqlTranslatorFactory, extendedTypes, identifiersEndQuote, identifiersStartQuote, pkGenerator, supportsBatchUpdates, supportsFkConstraints, supportsGeneratedKeys, supportsUniqueConstraints, typesHandler
 
Constructor Summary
SQLServerAdapter()
           
 
Method Summary
 void createTableAppendColumn(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.
 MergerFactory mergerFactory()
           
 
Methods inherited from class org.apache.cayenne.dba.sybase.SybaseAdapter
bindParameter, configureExtendedTypes, createEJBQLTranslatorFactory, createPkGenerator, getBatchTerminator, initIdentifiersQuotes
 
Methods inherited from class org.apache.cayenne.dba.JdbcAdapter
buildAttribute, createFkConstraint, createTable, createTableAppendPKClause, createUniqueConstraint, dropTable, dropTableStatements, externalTypesForJdbcType, findAdapterResource, findResource, getEjbqlTranslatorFactory, getExtendedTypes, getIdentifiersEndQuote, getIdentifiersStartQuote, getPkGenerator, getQuotingStrategy, setEjbqlTranslatorFactory, setPkGenerator, setSupportsBatchUpdates, setSupportsFkConstraints, setSupportsGeneratedKeys, setSupportsUniqueConstraints, 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 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

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

Specified by:
createTableAppendColumn in interface DbAdapter
Overrides:
createTableAppendColumn in class JdbcAdapter
Parameters:
sqlBuffer - the StringBuffer to append the column type to
column - the DbAttribute defining the column to append type for
Since:
1.2

mergerFactory

public MergerFactory mergerFactory()
Specified by:
mergerFactory in interface DbAdapter
Overrides:
mergerFactory in class SybaseAdapter


Copyright © 2001-2011 Apache Cayenne. All Rights Reserved.