|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.torque.adapter.AbstractAdapter
org.apache.torque.adapter.MssqlAdapter
public class MssqlAdapter
This is used to connect to a MSSQL database. This is tested with the jtds driver from sourceforge.
Field Summary |
---|
Fields inherited from interface org.apache.torque.adapter.Adapter |
---|
ADAPTER_KEY, AUTODETECT_ADAPTER, DRIVER_KEY |
Constructor Summary | |
---|---|
protected |
MssqlAdapter()
Empty constructor. |
Method Summary | |
---|---|
boolean |
escapeText()
Determines whether backslashes (\) should be escaped in explicit SQL strings. |
void |
generateLimits(Query query,
long offset,
int limit)
Modify a query to add limit and offset values for Sybase. |
String |
getIDMethodSQL(Object unused)
Returns the last value from an identity column (available on a per-session basis from the global variable @@identity ). |
IDMethod |
getIDMethodType()
Returns the constant from the IDMethod interface denoting which
type of primary key generation method this type of RDBMS uses. |
String |
getUpdateLockClause()
Returns the clause which acquires a write lock on a row when doing a select. |
String |
ignoreCase(String in)
This method is used to ignore case. |
void |
lockTable(Connection con,
String table)
Locks the specified table. |
boolean |
supportsNativeLimit()
Return true for Sybase |
String |
toUpperCase(String in)
This method is used to ignore case. |
void |
unlockTable(Connection con,
String table)
Tries to unlock the specified table. |
boolean |
useEscapeClauseForLike()
Whether an escape clause in like should be used. |
Methods inherited from class org.apache.torque.adapter.AbstractAdapter |
---|
getStringDelimiter, ignoreCaseInOrderBy, supportsNativeOffset, useIlike |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected MssqlAdapter()
Method Detail |
---|
public String toUpperCase(String in)
toUpperCase
in interface Adapter
toUpperCase
in class AbstractAdapter
in
- The string to transform to upper case.
public String ignoreCase(String in)
ignoreCase
in interface Adapter
ignoreCase
in class AbstractAdapter
in
- The string whose case to ignore.
public IDMethod getIDMethodType()
AbstractAdapter
IDMethod
interface denoting which
type of primary key generation method this type of RDBMS uses.
getIDMethodType
in interface Adapter
getIDMethodType
in class AbstractAdapter
Adapter.getIDMethodType()
public String getIDMethodSQL(Object unused)
@@identity
).
getIDMethodSQL
in interface Adapter
getIDMethodSQL
in class AbstractAdapter
unused
- Information used for key generation.
Adapter.getIDMethodSQL(Object obj)
public String getUpdateLockClause()
getUpdateLockClause
in interface Adapter
getUpdateLockClause
in class AbstractAdapter
public void lockTable(Connection con, String table) throws SQLException
lockTable
in interface Adapter
lockTable
in class AbstractAdapter
con
- The JDBC connection to use.table
- The name of the table to lock.
SQLException
- No Statement could be created or executed.public void unlockTable(Connection con, String table) throws SQLException
unlockTable
in interface Adapter
unlockTable
in class AbstractAdapter
con
- The JDBC connection to use.table
- The name of the table to unlock.
SQLException
- No Statement could be created or executed.public boolean supportsNativeLimit()
supportsNativeLimit
in interface Adapter
supportsNativeLimit
in class AbstractAdapter
AbstractAdapter.supportsNativeLimit()
public void generateLimits(Query query, long offset, int limit) throws TorqueException
generateLimits
in interface Adapter
generateLimits
in class AbstractAdapter
query
- The query to modifyoffset
- the offset Valuelimit
- the limit Value
TorqueException
- if any error occurs when building the querypublic boolean escapeText()
escapeText
in interface Adapter
escapeText
in class AbstractAdapter
Adapter.escapeText()
public boolean useEscapeClauseForLike()
true
.
useEscapeClauseForLike
in interface Adapter
useEscapeClauseForLike
in class AbstractAdapter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |