DBConnection

Inheritance: java.lang.Object, com.aspose.cells.ExternalConnection

public class DBConnection extends ExternalConnection

Specifies all properties associated with an ODBC or OLE DB external data connection.

Methods

MethodDescription
equals(Object arg0)
getBackgroundRefresh()Indicates whether the connection can be refreshed in the background (asynchronously).
getClass()
getClassType()Gets the type of this ExternalConnection object.
getCommand()The string containing the database command to pass to the data provider API that will interact with the external source in order to retrieve data
getCommandType()Specifies the OLE DB command type. 1.
getConnectionDescription()Specifies the user description for this connection
getConnectionFile()Gets the connection file.
getConnectionId()Specifies The unique identifier of this connection.
getConnectionInfo()The connection information string is used to make contact with an OLE DB or ODBC data source.
getConnectionString()The connection information string is used to make contact with an OLE DB or ODBC data source.
getCredentials()Specifies the authentication method to be used when establishing (or re-establishing) the connection.
getCredentialsMethodType()Specifies the authentication method to be used when establishing (or re-establishing) the connection.
getId()Gets the id of the connection.
getKeepAlive()True when the spreadsheet application should make efforts to keep the connection open.
getName()Specifies the name of the connection.
getOdcFile()Specifies the full path to external connection file from which this connection was created.
getOnlyUseConnectionFile()Indicates whether the spreadsheet application should always and only use the connection information in the external connection file indicated by the odcFile attribute when the connection is refreshed.
getParameters()Gets ConnectionParameterCollection for an ODBC or web query.
getPowerQueryFormula()Gets the definition of power query formula.
getReconnectionMethod()Specifies what the spreadsheet application should do when a connection fails.
getReconnectionMethodType()Specifies what the spreadsheet application should do when a connection fails.
getRefreshInternal()Specifies the number of minutes between automatic refreshes of the connection.
getRefreshOnLoad()True if this connection should be refreshed when opening the file; otherwise, false.
getSSOId()Identifier for Single Sign On (SSO) used for authentication between an intermediate spreadsheetML server and the external data source.
getSaveData()True if the external data fetched over the connection to populate a table is to be saved with the workbook; otherwise, false.
getSavePassword()True if the password is to be saved as part of the connection string; otherwise, False.
getSecondCommand()Specifies a second command text string that is persisted when PivotTable server-based page fields are in use.
getSeverCommand()Specifies a second command text string that is persisted when PivotTable server-based page fields are in use.
getSourceFile()Used when the external data source is file-based.
getSourceType()Gets the external connection DataSource type.
getType()Gets the external connection DataSource type.
hashCode()
isDeleted()Indicates whether the associated workbook connection has been deleted.
isNew()True if the connection has not been refreshed for the first time; otherwise, false.
notify()
notifyAll()
setBackgroundRefresh(boolean value)Indicates whether the connection can be refreshed in the background (asynchronously).
setCommand(String value)The string containing the database command to pass to the data provider API that will interact with the external source in order to retrieve data
setCommandType(int value)Specifies the OLE DB command type. 1.
setConnectionDescription(String value)Specifies the user description for this connection
setConnectionInfo(String value)The connection information string is used to make contact with an OLE DB or ODBC data source.
setConnectionString(String value)The connection information string is used to make contact with an OLE DB or ODBC data source.
setCredentials(int value)Specifies the authentication method to be used when establishing (or re-establishing) the connection.
setCredentialsMethodType(int value)Specifies the authentication method to be used when establishing (or re-establishing) the connection.
setDeleted(boolean value)Indicates whether the associated workbook connection has been deleted.
setKeepAlive(boolean value)True when the spreadsheet application should make efforts to keep the connection open.
setName(String value)Specifies the name of the connection.
setNew(boolean value)True if the connection has not been refreshed for the first time; otherwise, false.
setOdcFile(String value)Specifies the full path to external connection file from which this connection was created.
setOnlyUseConnectionFile(boolean value)Indicates whether the spreadsheet application should always and only use the connection information in the external connection file indicated by the odcFile attribute when the connection is refreshed.
setReconnectionMethod(int value)Specifies what the spreadsheet application should do when a connection fails.
setReconnectionMethodType(int value)Specifies what the spreadsheet application should do when a connection fails.
setRefreshInternal(int value)Specifies the number of minutes between automatic refreshes of the connection.
setRefreshOnLoad(boolean value)True if this connection should be refreshed when opening the file; otherwise, false.
setSSOId(String value)Identifier for Single Sign On (SSO) used for authentication between an intermediate spreadsheetML server and the external data source.
setSaveData(boolean value)True if the external data fetched over the connection to populate a table is to be saved with the workbook; otherwise, false.
setSavePassword(boolean value)True if the password is to be saved as part of the connection string; otherwise, False.
setSecondCommand(String value)Specifies a second command text string that is persisted when PivotTable server-based page fields are in use.
setSeverCommand(String value)Specifies a second command text string that is persisted when PivotTable server-based page fields are in use.
setSourceFile(String value)Used when the external data source is file-based.
setSourceType(int value)Sets the external connection DataSource type.
setType(int value)Sets the external connection DataSource type.
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getBackgroundRefresh()

public boolean getBackgroundRefresh()

Indicates whether the connection can be refreshed in the background (asynchronously). true if preferred usage of the connection is to refresh asynchronously in the background; false if preferred usage of the connection is to refresh synchronously in the foreground.

Returns: boolean

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getClassType()

public int getClassType()

Gets the type of this ExternalConnection object.

See ExternalConnectionClassType.

Returns: int

getCommand()

public String getCommand()

The string containing the database command to pass to the data provider API that will interact with the external source in order to retrieve data

Returns: java.lang.String

getCommandType()

public int getCommandType()

Specifies the OLE DB command type. 1. Query specifies a cube name 2. Query specifies a SQL statement 3. Query specifies a table name 4. Query specifies that default information has been given, and it is up to the provider how to interpret. 5. Query is against a web based List Data Provider.

See OLEDBCommandType.

Returns: int

getConnectionDescription()

public String getConnectionDescription()

Specifies the user description for this connection

Returns: java.lang.String

getConnectionFile()

public String getConnectionFile()

Gets the connection file.

Returns: java.lang.String

getConnectionId()

public int getConnectionId()

Specifies The unique identifier of this connection.

Remarks

NOTE: This property is now obsolete. Instead, please use ExternalConnection.Id property. This property will be removed 12 months later since October 2024. Aspose apologizes for any inconvenience you may have experienced.

Returns: int

getConnectionInfo()

public String getConnectionInfo()

The connection information string is used to make contact with an OLE DB or ODBC data source.

Remarks

NOTE: This property is now obsolete. Instead, please use ExternalConnection.ConnectionString property. This method will be removed 12 months later since October 2024. Aspose apologizes for any inconvenience you may have experienced.

Returns: java.lang.String

getConnectionString()

public String getConnectionString()

The connection information string is used to make contact with an OLE DB or ODBC data source.

Returns: java.lang.String

getCredentials()

public int getCredentials()

Specifies the authentication method to be used when establishing (or re-establishing) the connection.

See CredentialsMethodType.

Remarks

NOTE: This property is now obsolete. Instead, please use ExternalConnection.CredentialsMethodType property. This property will be removed 12 months later since October 2017. Aspose apologizes for any inconvenience you may have experienced.

Returns: int

getCredentialsMethodType()

public int getCredentialsMethodType()

Specifies the authentication method to be used when establishing (or re-establishing) the connection.

See CredentialsMethodType.

Returns: int

getId()

public int getId()

Gets the id of the connection.

Returns: int

getKeepAlive()

public boolean getKeepAlive()

True when the spreadsheet application should make efforts to keep the connection open. When false, the application should close the connection after retrieving the information.

Returns: boolean

getName()

public String getName()

Specifies the name of the connection. Each connection must have a unique name.

Returns: java.lang.String

getOdcFile()

public String getOdcFile()

Specifies the full path to external connection file from which this connection was created. If a connection fails during an attempt to refresh data, and reconnectionMethod=1, then the spreadsheet application will try again using information from the external connection file instead of the connection object embedded within the workbook.

Returns: java.lang.String

getOnlyUseConnectionFile()

public boolean getOnlyUseConnectionFile()

Indicates whether the spreadsheet application should always and only use the connection information in the external connection file indicated by the odcFile attribute when the connection is refreshed. If false, then the spreadsheet application should follow the procedure indicated by the reconnectionMethod attribute

Returns: boolean

getParameters()

public ConnectionParameterCollection getParameters()

Gets ConnectionParameterCollection for an ODBC or web query.

Returns: ConnectionParameterCollection

getPowerQueryFormula()

public PowerQueryFormula getPowerQueryFormula()

Gets the definition of power query formula.

Returns: PowerQueryFormula

getReconnectionMethod()

public int getReconnectionMethod()

Specifies what the spreadsheet application should do when a connection fails. The default value is ReConnectionMethodType.Required.

See ReConnectionMethodType.

Remarks

NOTE: This property is now obsolete. Instead, please use ExternalConnection.ReconnectionMethodType property. This property will be removed 12 months later since October 2017. Aspose apologizes for any inconvenience you may have experienced.

Returns: int

getReconnectionMethodType()

public int getReconnectionMethodType()

Specifies what the spreadsheet application should do when a connection fails. The default value is ReConnectionMethodType.Required.

See ReConnectionMethodType.

Returns: int

getRefreshInternal()

public int getRefreshInternal()

Specifies the number of minutes between automatic refreshes of the connection.

Returns: int

getRefreshOnLoad()

public boolean getRefreshOnLoad()

True if this connection should be refreshed when opening the file; otherwise, false.

Returns: boolean

getSSOId()

public String getSSOId()

Identifier for Single Sign On (SSO) used for authentication between an intermediate spreadsheetML server and the external data source.

Returns: java.lang.String

getSaveData()

public boolean getSaveData()

True if the external data fetched over the connection to populate a table is to be saved with the workbook; otherwise, false.

Returns: boolean

getSavePassword()

public boolean getSavePassword()

True if the password is to be saved as part of the connection string; otherwise, False.

Returns: boolean

getSecondCommand()

public String getSecondCommand()

Specifies a second command text string that is persisted when PivotTable server-based page fields are in use. For ODBC connections, serverCommand is usually a broader query than command (no WHERE clause is present in the former). Based on these 2 commands(Command and ServerCommand), parameter UI can be populated and parameterized queries can be constructed

Returns: java.lang.String

getSeverCommand()

public String getSeverCommand()

Specifies a second command text string that is persisted when PivotTable server-based page fields are in use. For ODBC connections, serverCommand is usually a broader query than command (no WHERE clause is present in the former). Based on these 2 commands(Command and ServerCommand), parameter UI can be populated and parameterized queries can be constructed

Remarks

NOTE: This property is now obsolete. Instead, please use ExternalConnection.SecondCommand property. This method will be removed 12 months later since October 2024. Aspose apologizes for any inconvenience you may have experienced.

Returns: java.lang.String

getSourceFile()

public String getSourceFile()

Used when the external data source is file-based. When a connection to such a data source fails, the spreadsheet application attempts to connect directly to this file. May be expressed in URI or system-specific file path notation.

Returns: java.lang.String

getSourceType()

public int getSourceType()

Gets the external connection DataSource type.

See ConnectionDataSourceType.

Returns: int

getType()

public int getType()

Gets the external connection DataSource type.

See ConnectionDataSourceType.

Remarks

NOTE: This property is now obsolete. Instead, please use ExternalConnection.SourceType property. This property will be removed 12 months later since October 2024. Aspose apologizes for any inconvenience you may have experienced.

Returns: int

hashCode()

public native int hashCode()

Returns: int

isDeleted()

public boolean isDeleted()

Indicates whether the associated workbook connection has been deleted. true if the connection has been deleted; otherwise, false.

Returns: boolean

isNew()

public boolean isNew()

True if the connection has not been refreshed for the first time; otherwise, false. This state can happen when the user saves the file before a query has finished returning.

Returns: boolean

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

setBackgroundRefresh(boolean value)

public void setBackgroundRefresh(boolean value)

Indicates whether the connection can be refreshed in the background (asynchronously). true if preferred usage of the connection is to refresh asynchronously in the background; false if preferred usage of the connection is to refresh synchronously in the foreground.

Parameters:

ParameterTypeDescription
valueboolean

setCommand(String value)

public void setCommand(String value)

The string containing the database command to pass to the data provider API that will interact with the external source in order to retrieve data

Parameters:

ParameterTypeDescription
valuejava.lang.String

setCommandType(int value)

public void setCommandType(int value)

Specifies the OLE DB command type. 1. Query specifies a cube name 2. Query specifies a SQL statement 3. Query specifies a table name 4. Query specifies that default information has been given, and it is up to the provider how to interpret. 5. Query is against a web based List Data Provider.

See OLEDBCommandType.

Parameters:

ParameterTypeDescription
valueint

setConnectionDescription(String value)

public void setConnectionDescription(String value)

Specifies the user description for this connection

Parameters:

ParameterTypeDescription
valuejava.lang.String

setConnectionInfo(String value)

public void setConnectionInfo(String value)

The connection information string is used to make contact with an OLE DB or ODBC data source.

Remarks

NOTE: This property is now obsolete. Instead, please use ExternalConnection.ConnectionString property. This method will be removed 12 months later since October 2024. Aspose apologizes for any inconvenience you may have experienced.

Parameters:

ParameterTypeDescription
valuejava.lang.String

setConnectionString(String value)

public void setConnectionString(String value)

The connection information string is used to make contact with an OLE DB or ODBC data source.

Parameters:

ParameterTypeDescription
valuejava.lang.String

setCredentials(int value)

public void setCredentials(int value)

Specifies the authentication method to be used when establishing (or re-establishing) the connection.

See CredentialsMethodType.

Remarks

NOTE: This property is now obsolete. Instead, please use ExternalConnection.CredentialsMethodType property. This property will be removed 12 months later since October 2017. Aspose apologizes for any inconvenience you may have experienced.

Parameters:

ParameterTypeDescription
valueint

setCredentialsMethodType(int value)

public void setCredentialsMethodType(int value)

Specifies the authentication method to be used when establishing (or re-establishing) the connection.

See CredentialsMethodType.

Parameters:

ParameterTypeDescription
valueint

setDeleted(boolean value)

public void setDeleted(boolean value)

Indicates whether the associated workbook connection has been deleted. true if the connection has been deleted; otherwise, false.

Parameters:

ParameterTypeDescription
valueboolean

setKeepAlive(boolean value)

public void setKeepAlive(boolean value)

True when the spreadsheet application should make efforts to keep the connection open. When false, the application should close the connection after retrieving the information.

Parameters:

ParameterTypeDescription
valueboolean

setName(String value)

public void setName(String value)

Specifies the name of the connection. Each connection must have a unique name.

Parameters:

ParameterTypeDescription
valuejava.lang.String

setNew(boolean value)

public void setNew(boolean value)

True if the connection has not been refreshed for the first time; otherwise, false. This state can happen when the user saves the file before a query has finished returning.

Parameters:

ParameterTypeDescription
valueboolean

setOdcFile(String value)

public void setOdcFile(String value)

Specifies the full path to external connection file from which this connection was created. If a connection fails during an attempt to refresh data, and reconnectionMethod=1, then the spreadsheet application will try again using information from the external connection file instead of the connection object embedded within the workbook.

Parameters:

ParameterTypeDescription
valuejava.lang.String

setOnlyUseConnectionFile(boolean value)

public void setOnlyUseConnectionFile(boolean value)

Indicates whether the spreadsheet application should always and only use the connection information in the external connection file indicated by the odcFile attribute when the connection is refreshed. If false, then the spreadsheet application should follow the procedure indicated by the reconnectionMethod attribute

Parameters:

ParameterTypeDescription
valueboolean

setReconnectionMethod(int value)

public void setReconnectionMethod(int value)

Specifies what the spreadsheet application should do when a connection fails. The default value is ReConnectionMethodType.Required.

See ReConnectionMethodType.

Remarks

NOTE: This property is now obsolete. Instead, please use ExternalConnection.ReconnectionMethodType property. This property will be removed 12 months later since October 2017. Aspose apologizes for any inconvenience you may have experienced.

Parameters:

ParameterTypeDescription
valueint

setReconnectionMethodType(int value)

public void setReconnectionMethodType(int value)

Specifies what the spreadsheet application should do when a connection fails. The default value is ReConnectionMethodType.Required.

See ReConnectionMethodType.

Parameters:

ParameterTypeDescription
valueint

setRefreshInternal(int value)

public void setRefreshInternal(int value)

Specifies the number of minutes between automatic refreshes of the connection.

Parameters:

ParameterTypeDescription
valueint

setRefreshOnLoad(boolean value)

public void setRefreshOnLoad(boolean value)

True if this connection should be refreshed when opening the file; otherwise, false.

Parameters:

ParameterTypeDescription
valueboolean

setSSOId(String value)

public void setSSOId(String value)

Identifier for Single Sign On (SSO) used for authentication between an intermediate spreadsheetML server and the external data source.

Parameters:

ParameterTypeDescription
valuejava.lang.String

setSaveData(boolean value)

public void setSaveData(boolean value)

True if the external data fetched over the connection to populate a table is to be saved with the workbook; otherwise, false.

Parameters:

ParameterTypeDescription
valueboolean

setSavePassword(boolean value)

public void setSavePassword(boolean value)

True if the password is to be saved as part of the connection string; otherwise, False.

Parameters:

ParameterTypeDescription
valueboolean

setSecondCommand(String value)

public void setSecondCommand(String value)

Specifies a second command text string that is persisted when PivotTable server-based page fields are in use. For ODBC connections, serverCommand is usually a broader query than command (no WHERE clause is present in the former). Based on these 2 commands(Command and ServerCommand), parameter UI can be populated and parameterized queries can be constructed

Parameters:

ParameterTypeDescription
valuejava.lang.String

setSeverCommand(String value)

public void setSeverCommand(String value)

Specifies a second command text string that is persisted when PivotTable server-based page fields are in use. For ODBC connections, serverCommand is usually a broader query than command (no WHERE clause is present in the former). Based on these 2 commands(Command and ServerCommand), parameter UI can be populated and parameterized queries can be constructed

Remarks

NOTE: This property is now obsolete. Instead, please use ExternalConnection.SecondCommand property. This method will be removed 12 months later since October 2024. Aspose apologizes for any inconvenience you may have experienced.

Parameters:

ParameterTypeDescription
valuejava.lang.String

setSourceFile(String value)

public void setSourceFile(String value)

Used when the external data source is file-based. When a connection to such a data source fails, the spreadsheet application attempts to connect directly to this file. May be expressed in URI or system-specific file path notation.

Parameters:

ParameterTypeDescription
valuejava.lang.String

setSourceType(int value)

public void setSourceType(int value)

Sets the external connection DataSource type.

See ConnectionDataSourceType.

Parameters:

ParameterTypeDescription
valueint

setType(int value)

public void setType(int value)

Sets the external connection DataSource type.

See ConnectionDataSourceType.

Remarks

NOTE: This property is now obsolete. Instead, please use ExternalConnection.SourceType property. This property will be removed 12 months later since October 2024. Aspose apologizes for any inconvenience you may have experienced.

Parameters:

ParameterTypeDescription
valueint

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int