Partage via


SqlConnectionInfo Class

public final class SqlConnectionInfo
extends ConnectionInfo

Information for connecting to SQL database server.

Constructor Summary

Constructor Description
SqlConnectionInfo()

Creates an instance of SqlConnectionInfo class.

Method Summary

Modifier and Type Method and Description
String additionalSettings()

Get the additionalSettings property: Additional connection settings.

AuthenticationType authentication()

Get the authentication property: Authentication type to use for connection.

String dataSource()

Get the dataSource property: Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber.

Boolean encryptConnection()

Get the encryptConnection property: Whether to encrypt the connection.

static SqlConnectionInfo fromJson(JsonReader jsonReader)

Reads an instance of SqlConnectionInfo from the JsonReader.

SqlSourcePlatform platform()

Get the platform property: Server platform type for connection.

Integer port()

Get the port property: Port for Server.

String resourceId()

Get the resourceId property: Represents the ID of an HTTP resource represented by an Azure resource provider.

String serverBrandVersion()

Get the serverBrandVersion property: server brand version.

String serverName()

Get the serverName property: name of the server.

String serverVersion()

Get the serverVersion property: server version.

JsonWriter toJson(JsonWriter jsonWriter)
Boolean trustServerCertificate()

Get the trustServerCertificate property: Whether to trust the server certificate.

String type()

Get the type property: Type of connection info.

void validate()

Validates the instance.

SqlConnectionInfo withAdditionalSettings(String additionalSettings)

Set the additionalSettings property: Additional connection settings.

SqlConnectionInfo withAuthentication(AuthenticationType authentication)

Set the authentication property: Authentication type to use for connection.

SqlConnectionInfo withDataSource(String dataSource)

Set the dataSource property: Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber.

SqlConnectionInfo withEncryptConnection(Boolean encryptConnection)

Set the encryptConnection property: Whether to encrypt the connection.

SqlConnectionInfo withPassword(String password)

Set the password property: Password credential.

SqlConnectionInfo withPlatform(SqlSourcePlatform platform)

Set the platform property: Server platform type for connection.

SqlConnectionInfo withPort(Integer port)

Set the port property: Port for Server.

SqlConnectionInfo withResourceId(String resourceId)

Set the resourceId property: Represents the ID of an HTTP resource represented by an Azure resource provider.

SqlConnectionInfo withServerBrandVersion(String serverBrandVersion)

Set the serverBrandVersion property: server brand version.

SqlConnectionInfo withServerName(String serverName)

Set the serverName property: name of the server.

SqlConnectionInfo withServerVersion(String serverVersion)

Set the serverVersion property: server version.

SqlConnectionInfo withTrustServerCertificate(Boolean trustServerCertificate)

Set the trustServerCertificate property: Whether to trust the server certificate.

SqlConnectionInfo withUsername(String username)

Set the username property: User name.

Methods inherited from ConnectionInfo

Methods inherited from java.lang.Object

Constructor Details

SqlConnectionInfo

public SqlConnectionInfo()

Creates an instance of SqlConnectionInfo class.

Method Details

additionalSettings

public String additionalSettings()

Get the additionalSettings property: Additional connection settings.

Returns:

the additionalSettings value.

authentication

public AuthenticationType authentication()

Get the authentication property: Authentication type to use for connection.

Returns:

the authentication value.

dataSource

public String dataSource()

Get the dataSource property: Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber.

Returns:

the dataSource value.

encryptConnection

public Boolean encryptConnection()

Get the encryptConnection property: Whether to encrypt the connection.

Returns:

the encryptConnection value.

fromJson

public static SqlConnectionInfo fromJson(JsonReader jsonReader)

Reads an instance of SqlConnectionInfo from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of SqlConnectionInfo if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

platform

public SqlSourcePlatform platform()

Get the platform property: Server platform type for connection.

Returns:

the platform value.

port

public Integer port()

Get the port property: Port for Server.

Returns:

the port value.

resourceId

public String resourceId()

Get the resourceId property: Represents the ID of an HTTP resource represented by an Azure resource provider.

Returns:

the resourceId value.

serverBrandVersion

public String serverBrandVersion()

Get the serverBrandVersion property: server brand version.

Returns:

the serverBrandVersion value.

serverName

public String serverName()

Get the serverName property: name of the server.

Returns:

the serverName value.

serverVersion

public String serverVersion()

Get the serverVersion property: server version.

Returns:

the serverVersion value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

SqlConnectionInfo.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

trustServerCertificate

public Boolean trustServerCertificate()

Get the trustServerCertificate property: Whether to trust the server certificate.

Returns:

the trustServerCertificate value.

type

public String type()

Get the type property: Type of connection info.

Overrides:

SqlConnectionInfo.type()

Returns:

the type value.

validate

public void validate()

Validates the instance.

Overrides:

SqlConnectionInfo.validate()

withAdditionalSettings

public SqlConnectionInfo withAdditionalSettings(String additionalSettings)

Set the additionalSettings property: Additional connection settings.

Parameters:

additionalSettings - the additionalSettings value to set.

Returns:

the SqlConnectionInfo object itself.

withAuthentication

public SqlConnectionInfo withAuthentication(AuthenticationType authentication)

Set the authentication property: Authentication type to use for connection.

Parameters:

authentication - the authentication value to set.

Returns:

the SqlConnectionInfo object itself.

withDataSource

public SqlConnectionInfo withDataSource(String dataSource)

Set the dataSource property: Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber.

Parameters:

dataSource - the dataSource value to set.

Returns:

the SqlConnectionInfo object itself.

withEncryptConnection

public SqlConnectionInfo withEncryptConnection(Boolean encryptConnection)

Set the encryptConnection property: Whether to encrypt the connection.

Parameters:

encryptConnection - the encryptConnection value to set.

Returns:

the SqlConnectionInfo object itself.

withPassword

public SqlConnectionInfo withPassword(String password)

Set the password property: Password credential.

Overrides:

SqlConnectionInfo.withPassword(String password)

Parameters:

password

withPlatform

public SqlConnectionInfo withPlatform(SqlSourcePlatform platform)

Set the platform property: Server platform type for connection.

Parameters:

platform - the platform value to set.

Returns:

the SqlConnectionInfo object itself.

withPort

public SqlConnectionInfo withPort(Integer port)

Set the port property: Port for Server.

Parameters:

port - the port value to set.

Returns:

the SqlConnectionInfo object itself.

withResourceId

public SqlConnectionInfo withResourceId(String resourceId)

Set the resourceId property: Represents the ID of an HTTP resource represented by an Azure resource provider.

Parameters:

resourceId - the resourceId value to set.

Returns:

the SqlConnectionInfo object itself.

withServerBrandVersion

public SqlConnectionInfo withServerBrandVersion(String serverBrandVersion)

Set the serverBrandVersion property: server brand version.

Parameters:

serverBrandVersion - the serverBrandVersion value to set.

Returns:

the SqlConnectionInfo object itself.

withServerName

public SqlConnectionInfo withServerName(String serverName)

Set the serverName property: name of the server.

Parameters:

serverName - the serverName value to set.

Returns:

the SqlConnectionInfo object itself.

withServerVersion

public SqlConnectionInfo withServerVersion(String serverVersion)

Set the serverVersion property: server version.

Parameters:

serverVersion - the serverVersion value to set.

Returns:

the SqlConnectionInfo object itself.

withTrustServerCertificate

public SqlConnectionInfo withTrustServerCertificate(Boolean trustServerCertificate)

Set the trustServerCertificate property: Whether to trust the server certificate.

Parameters:

trustServerCertificate - the trustServerCertificate value to set.

Returns:

the SqlConnectionInfo object itself.

withUsername

public SqlConnectionInfo withUsername(String username)

Set the username property: User name.

Overrides:

SqlConnectionInfo.withUsername(String username)

Parameters:

username

Applies to