Class SQLServerConnection43

java.lang.Object
com.microsoft.sqlserver.jdbc.SQLServerConnection
com.microsoft.sqlserver.jdbc.SQLServerConnection43
All Implemented Interfaces:
ISQLServerConnection, ISQLServerConnection43, java.io.Serializable, java.lang.AutoCloseable, java.sql.Connection, java.sql.Wrapper

public class SQLServerConnection43
extends SQLServerConnection
implements ISQLServerConnection43
Extends SQLServerConnection43 and implements ISQLServerConnection43 with methods introduced in JDBC 4.3 Specifications. This class is used by the driver when initializing a class with with JDBC 4.3 Specs supported JVM.
See Also:
Serialized Form
  • Method Details

    • beginRequest

      public void beginRequest() throws java.sql.SQLException
      Description copied from interface: ISQLServerConnection43
      Hints to the driver that a request, an independent unit of work, is beginning on this connection. It backs up the values of the connection properties that are modifiable through public methods. Each request is independent of all other requests with regard to state local to the connection either on the client or the server. Work done between beginRequest, endRequest pairs does not depend on any other work done on the connection either as part of another request or outside of any request. A request may include multiple transactions. There may be dependencies on committed database state as that is not local to the connection. beginRequest marks the beginning of the work unit.

      Local state is defined as any state associated with a Connection that is local to the current Connection either in the client or the database that is not transparently reproducible.

      Calls to beginRequest and endRequest are not nested. Multiple calls to beginRequest without an intervening call to endRequest is not an error. The first beginRequest call marks the start of the request and subsequent calls are treated as a no-op It is recommended to enclose each unit of work in beginRequest, endRequest pairs such that there is no open transaction at the beginning or end of the request and no dependency on local state that crosses request boundaries. Committed database state is not local. This method is to be used by Connection pooling managers.

      The pooling manager should call beginRequest on the underlying connection prior to returning a connection to the caller.

      Specified by:
      beginRequest in interface java.sql.Connection
      Specified by:
      beginRequest in interface ISQLServerConnection43
      Throws:
      java.sql.SQLException - if an error occurs
      See Also:
      ISQLServerConnection43.endRequest()
    • endRequest

      public void endRequest() throws java.sql.SQLException
      Description copied from interface: ISQLServerConnection43
      Hints to the driver that a request, an independent unit of work, has completed. It rolls back the open transactions. Resets the connection properties that are modifiable through public methods back to their original values. Calls to beginRequest and endRequest are not nested. Multiple calls to endRequest without an intervening call to beginRequest is not an error. The first endRequest call marks the request completed and subsequent calls are treated as a no-op. If endRequest is called without an initial call to beginRequest is a no-op. This method is to be used by Connection pooling managers.

      Specified by:
      endRequest in interface java.sql.Connection
      Specified by:
      endRequest in interface ISQLServerConnection43
      Throws:
      java.sql.SQLException - if an error occurs
      See Also:
      ISQLServerConnection43.beginRequest()
    • setShardingKey

      public void setShardingKey​(java.sql.ShardingKey shardingKey) throws java.sql.SQLException
      Specified by:
      setShardingKey in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • setShardingKey

      public void setShardingKey​(java.sql.ShardingKey shardingKey, java.sql.ShardingKey superShardingKey) throws java.sql.SQLException
      Specified by:
      setShardingKey in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • setShardingKeyIfValid

      public boolean setShardingKeyIfValid​(java.sql.ShardingKey shardingKey, int timeout) throws java.sql.SQLException
      Specified by:
      setShardingKeyIfValid in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • setShardingKeyIfValid

      public boolean setShardingKeyIfValid​(java.sql.ShardingKey shardingKey, java.sql.ShardingKey superShardingKey, int timeout) throws java.sql.SQLException
      Specified by:
      setShardingKeyIfValid in interface java.sql.Connection
      Throws:
      java.sql.SQLException