次の方法で共有


IConnection.IsValid(Int32) Method

Definition

Returns true if the connection has not been closed and is still valid.

[Android.Runtime.Register("isValid", "(I)Z", "GetIsValid_IHandler:Java.Sql.IConnectionInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public bool IsValid (int timeout);
[<Android.Runtime.Register("isValid", "(I)Z", "GetIsValid_IHandler:Java.Sql.IConnectionInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member IsValid : int -> bool

Parameters

timeout
Int32
  •         The time in seconds to wait for the database operation
                                                       used to validate the connection to complete.  If
                                                       the timeout period expires before the operation
                                                       completes, this method returns false.  A value of
                                                       0 indicates a timeout is not applied to the
                                                       database operation.
          &lt;p&gt;
    

Returns

true if the connection is valid, false otherwise

Attributes

Exceptions

if timeout

Remarks

Returns true if the connection has not been closed and is still valid. The driver shall submit a query on the connection or use some other mechanism that positively verifies the connection is still valid when this method is called.

The query submitted by the driver to validate the connection shall be executed in the context of the current transaction.

Added in 1.6 <p>.

Java documentation for java.sql.Connection.isValid(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to