Package org.apache.torque.adapter
Klasse MssqlAdapter
java.lang.Object
org.apache.torque.adapter.AbstractAdapter
org.apache.torque.adapter.MssqlAdapter
- Alle implementierten Schnittstellen:
Serializable,Adapter
This is used to connect to a MSSQL database.
This is tested with the jtds driver from sourceforge.
- Version:
- $Id: MssqlAdapter.java 1848527 2018-12-09 16:27:22Z tv $
- Autor:
- Gonzalo Diethelm
- Siehe auch:
-
Feldübersicht
Von Schnittstelle geerbte Felder org.apache.torque.adapter.Adapter
ADAPTER_KEY, AUTODETECT_ADAPTER, DRIVER_KEY -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleanDetermines whether backslashes (\) should be escaped in explicit SQL strings.voidgenerateLimits(Query query, long offset, int limit) Modify a query to add limit and offset values for MSSQL.getIDMethodSQL(Object unused) Returns the last value from an identity column (available on a per-session basis from the global variable@@identity).Returns the constant from theIDMethodinterface denoting which type of primary key generation method this type of RDBMS uses.Returns the clause which acquires a write lock on a row when doing a select.ignoreCase(String in) This method is used to ignore case.voidlockTable(Connection con, String table) Locks the specified table.booleanReturns whether the database natively supports returning results starting at an offset position other than 0.toUpperCase(String in) This method is used to ignore case.voidunlockTable(Connection con, String table) Tries to unlock the specified table.booleanWhether an escape clause in like should be used.Von Klasse geerbte Methoden org.apache.torque.adapter.AbstractAdapter
getStringDelimiter, ignoreCaseInOrderBy, setCapabilities, supportsNativeLimit, useGetGeneratedKeys, useIlike, useMinusForExcept
-
Konstruktordetails
-
MssqlAdapter
protected MssqlAdapter()Empty constructor.
-
-
Methodendetails
-
toUpperCase
This method is used to ignore case.- Angegeben von:
toUpperCasein SchnittstelleAdapter- Angegeben von:
toUpperCasein KlasseAbstractAdapter- Parameter:
in- The string to transform to upper case.- Gibt zurück:
- The upper case string.
-
ignoreCase
This method is used to ignore case.- Angegeben von:
ignoreCasein SchnittstelleAdapter- Angegeben von:
ignoreCasein KlasseAbstractAdapter- Parameter:
in- The string whose case to ignore.- Gibt zurück:
- The string in a case that can be ignored.
-
getIDMethodType
Beschreibung aus Klasse kopiert:AbstractAdapterReturns the constant from theIDMethodinterface denoting which type of primary key generation method this type of RDBMS uses.- Angegeben von:
getIDMethodTypein SchnittstelleAdapter- Angegeben von:
getIDMethodTypein KlasseAbstractAdapter- Gibt zurück:
- IDMethod constant
- Siehe auch:
-
getIDMethodSQL
Returns the last value from an identity column (available on a per-session basis from the global variable@@identity).- Angegeben von:
getIDMethodSQLin SchnittstelleAdapter- Angegeben von:
getIDMethodSQLin KlasseAbstractAdapter- Parameter:
unused- Information used for key generation.- Gibt zurück:
- The most recently inserted database key.
- Siehe auch:
-
getUpdateLockClause
Returns the clause which acquires a write lock on a row when doing a select.- Angegeben von:
getUpdateLockClausein SchnittstelleAdapter- Setzt außer Kraft:
getUpdateLockClausein KlasseAbstractAdapter- Gibt zurück:
- the SQL clause to acquire a write lock. This implementation returns "WITH (UPDLOCK)";
-
lockTable
Locks the specified table.- Angegeben von:
lockTablein SchnittstelleAdapter- Angegeben von:
lockTablein KlasseAbstractAdapter- Parameter:
con- The JDBC connection to use.table- The name of the table to lock.- Löst aus:
SQLException- No Statement could be created or executed.
-
unlockTable
Tries to unlock the specified table. This implementation does nothing as tables in MSSQL are unlocked when a commit or rollback is issued. This has unintended side effects, as well as we do not know whether to use commit or rollback. The lock will go away automatically when the transaction is ended.- Angegeben von:
unlockTablein SchnittstelleAdapter- Angegeben von:
unlockTablein KlasseAbstractAdapter- Parameter:
con- The JDBC connection to use.table- The name of the table to unlock.- Löst aus:
SQLException- No Statement could be created or executed.
-
supportsNativeOffset
public boolean supportsNativeOffset()Returns whether the database natively supports returning results starting at an offset position other than 0. Return false for MSSQL- Angegeben von:
supportsNativeOffsetin SchnittstelleAdapter- Setzt außer Kraft:
supportsNativeOffsetin KlasseAbstractAdapter- Gibt zurück:
- true if the database natively supports returning results starting at an offset position other than 0.
-
generateLimits
Modify a query to add limit and offset values for MSSQL.- Angegeben von:
generateLimitsin SchnittstelleAdapter- Setzt außer Kraft:
generateLimitsin KlasseAbstractAdapter- Parameter:
query- The query to modifyoffset- the offset Valuelimit- the limit Value- Löst aus:
TorqueException- if any error occurs when building the query
-
escapeText
public boolean escapeText()Determines whether backslashes (\) should be escaped in explicit SQL strings. If true is returned, a BACKSLASH will be changed to "\\". If false is returned, a BACKSLASH will be left as "\". Sybase (and MSSQL) doesn't define a default escape character, so false is returned.- Angegeben von:
escapeTextin SchnittstelleAdapter- Setzt außer Kraft:
escapeTextin KlasseAbstractAdapter- Gibt zurück:
- false
- Siehe auch:
-
useEscapeClauseForLike
public boolean useEscapeClauseForLike()Whether an escape clause in like should be used. Example : select * from AUTHOR where AUTHOR.NAME like '\_%' ESCAPE '\'; MSSQL needs this, so this implementation always returnstrue.- Angegeben von:
useEscapeClauseForLikein SchnittstelleAdapter- Setzt außer Kraft:
useEscapeClauseForLikein KlasseAbstractAdapter- Gibt zurück:
- whether the escape clause should be appended or not.
-