Share via


IDataSource.GetConnection(String, String) Method

Definition

Attempts to establish a connection with the data source that this DataSource object represents.

[Android.Runtime.Register("getConnection", "(Ljava/lang/String;Ljava/lang/String;)Ljava/sql/Connection;", "GetGetConnection_Ljava_lang_String_Ljava_lang_String_Handler:Javax.Sql.IDataSourceInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public Java.Sql.IConnection? GetConnection (string? username, string? password);
[<Android.Runtime.Register("getConnection", "(Ljava/lang/String;Ljava/lang/String;)Ljava/sql/Connection;", "GetGetConnection_Ljava_lang_String_Ljava_lang_String_Handler:Javax.Sql.IDataSourceInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member GetConnection : string * string -> Java.Sql.IConnection

Parameters

username
String

the database user on whose behalf the connection is being made

password
String

the user's password

Returns

a connection to the data source

Attributes

Exceptions

if there is a problem accessing the database.

Remarks

Attempts to establish a connection with the data source that this DataSource object represents.

Added in 1.4.

Java documentation for javax.sql.DataSource.getConnection(java.lang.String, java.lang.String).

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