Klasse MssqlAdapter

java.lang.Object
org.apache.torque.adapter.AbstractAdapter
org.apache.torque.adapter.MssqlAdapter
Alle implementierten Schnittstellen:
Serializable, Adapter

public class MssqlAdapter extends AbstractAdapter
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:
  • Konstruktordetails

    • MssqlAdapter

      protected MssqlAdapter()
      Empty constructor.
  • Methodendetails

    • toUpperCase

      public String toUpperCase(String in)
      This method is used to ignore case.
      Angegeben von:
      toUpperCase in Schnittstelle Adapter
      Angegeben von:
      toUpperCase in Klasse AbstractAdapter
      Parameter:
      in - The string to transform to upper case.
      Gibt zurück:
      The upper case string.
    • ignoreCase

      public String ignoreCase(String in)
      This method is used to ignore case.
      Angegeben von:
      ignoreCase in Schnittstelle Adapter
      Angegeben von:
      ignoreCase in Klasse AbstractAdapter
      Parameter:
      in - The string whose case to ignore.
      Gibt zurück:
      The string in a case that can be ignored.
    • getIDMethodType

      public IDMethod getIDMethodType()
      Beschreibung aus Klasse kopiert: AbstractAdapter
      Returns the constant from the IDMethod interface denoting which type of primary key generation method this type of RDBMS uses.
      Angegeben von:
      getIDMethodType in Schnittstelle Adapter
      Angegeben von:
      getIDMethodType in Klasse AbstractAdapter
      Gibt zurück:
      IDMethod constant
      Siehe auch:
    • getIDMethodSQL

      public String getIDMethodSQL(Object unused)
      Returns the last value from an identity column (available on a per-session basis from the global variable @@identity).
      Angegeben von:
      getIDMethodSQL in Schnittstelle Adapter
      Angegeben von:
      getIDMethodSQL in Klasse AbstractAdapter
      Parameter:
      unused - Information used for key generation.
      Gibt zurück:
      The most recently inserted database key.
      Siehe auch:
    • getUpdateLockClause

      public String getUpdateLockClause()
      Returns the clause which acquires a write lock on a row when doing a select.
      Angegeben von:
      getUpdateLockClause in Schnittstelle Adapter
      Setzt außer Kraft:
      getUpdateLockClause in Klasse AbstractAdapter
      Gibt zurück:
      the SQL clause to acquire a write lock. This implementation returns "WITH (UPDLOCK)";
    • lockTable

      public void lockTable(Connection con, String table) throws SQLException
      Locks the specified table.
      Angegeben von:
      lockTable in Schnittstelle Adapter
      Angegeben von:
      lockTable in Klasse AbstractAdapter
      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

      public void unlockTable(Connection con, String table) throws SQLException
      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:
      unlockTable in Schnittstelle Adapter
      Angegeben von:
      unlockTable in Klasse AbstractAdapter
      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:
      supportsNativeOffset in Schnittstelle Adapter
      Setzt außer Kraft:
      supportsNativeOffset in Klasse AbstractAdapter
      Gibt zurück:
      true if the database natively supports returning results starting at an offset position other than 0.
    • generateLimits

      public void generateLimits(Query query, long offset, int limit) throws TorqueException
      Modify a query to add limit and offset values for MSSQL.
      Angegeben von:
      generateLimits in Schnittstelle Adapter
      Setzt außer Kraft:
      generateLimits in Klasse AbstractAdapter
      Parameter:
      query - The query to modify
      offset - the offset Value
      limit - 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:
      escapeText in Schnittstelle Adapter
      Setzt außer Kraft:
      escapeText in Klasse AbstractAdapter
      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 returns true.
      Angegeben von:
      useEscapeClauseForLike in Schnittstelle Adapter
      Setzt außer Kraft:
      useEscapeClauseForLike in Klasse AbstractAdapter
      Gibt zurück:
      whether the escape clause should be appended or not.