Dela via


DriverManager.GetConnection Method

Definition

Overloads

GetConnection(String)

Attempts to establish a connection to the given database URL.

GetConnection(String, Properties)

Attempts to establish a connection to the given database URL.

GetConnection(String, String, String)

Attempts to establish a connection to the given database URL.

GetConnection(String)

Attempts to establish a connection to the given database URL.

[Android.Runtime.Register("getConnection", "(Ljava/lang/String;)Ljava/sql/Connection;", "")]
public static Java.Sql.IConnection? GetConnection (string? url);
[<Android.Runtime.Register("getConnection", "(Ljava/lang/String;)Ljava/sql/Connection;", "")>]
static member GetConnection : string -> Java.Sql.IConnection

Parameters

url
String

a database url of the form jdbc:<em>subprotocol</em>:<em>subname</em>

Returns

a connection to the URL

Attributes

Exceptions

if there is an error while attempting to connect to the database identified by the URL.

Remarks

Attempts to establish a connection to the given database URL. The DriverManager attempts to select an appropriate driver from the set of registered JDBC drivers.

Java documentation for java.sql.DriverManager.getConnection(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

GetConnection(String, Properties)

Attempts to establish a connection to the given database URL.

[Android.Runtime.Register("getConnection", "(Ljava/lang/String;Ljava/util/Properties;)Ljava/sql/Connection;", "")]
public static Java.Sql.IConnection? GetConnection (string? url, Java.Util.Properties? info);
[<Android.Runtime.Register("getConnection", "(Ljava/lang/String;Ljava/util/Properties;)Ljava/sql/Connection;", "")>]
static member GetConnection : string * Java.Util.Properties -> Java.Sql.IConnection

Parameters

url
String

a database url of the form jdbc:<em>subprotocol</em>:<em>subname</em>

info
Properties

a list of arbitrary string tag/value pairs as connection arguments; normally at least a "user" and "password" property should be included

Returns

a Connection to the URL

Attributes

Exceptions

if there is an error while attempting to connect to the database identified by the URL.

Remarks

Attempts to establish a connection to the given database URL. The DriverManager attempts to select an appropriate driver from the set of registered JDBC drivers.

Java documentation for java.sql.DriverManager.getConnection(java.lang.String, java.util.Properties).

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

GetConnection(String, String, String)

Attempts to establish a connection to the given database URL.

[Android.Runtime.Register("getConnection", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/sql/Connection;", "")]
public static Java.Sql.IConnection? GetConnection (string? url, string? user, string? password);
[<Android.Runtime.Register("getConnection", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/sql/Connection;", "")>]
static member GetConnection : string * string * string -> Java.Sql.IConnection

Parameters

url
String

a database url of the form jdbc:<em>subprotocol</em>:<em>subname</em>

user
String

the database user on whose behalf the connection is being made

password
String

the user's password

Returns

a connection to the URL

Attributes

Exceptions

if there is an error while attempting to connect to the database identified by the URL.

Remarks

Attempts to establish a connection to the given database URL. The DriverManager attempts to select an appropriate driver from the set of registered JDBC drivers.

Java documentation for java.sql.DriverManager.getConnection(java.lang.String, 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