語言

IConnection.IsValid(Int32) 方法

定義

如果連線尚未關閉且仍然有效,則會回傳為真。

[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

參數

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;
    

傳回

若連結有效,則為 true;否則為 false

屬性

例外狀況

如果 timeout

備註

如果連線尚未關閉且仍然有效,則會回傳為真。 驅動程式應對該連線提出查詢,或使用其他機制,在呼叫此方法時正面驗證連線是否有效。

驅動程式提交的查詢以驗證連線,必須在當前交易的情境中執行。

新增1.6 <分>。

Java 文件 java.sql.Connection.isValid(int)。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於