DataProviderInfoParseJdbcConnectionString Method |
Parses a JDBC connection string and extracts provider-specific parameter values.
Namespace:
Dundas.BI.Data.DataProviders
Assembly:
Dundas.BI.Core (in Dundas.BI.Core.dll) Version: 2.0.0.0 (25.4.0.1000)
Syntaxpublic ParameterValueCollection ParseJdbcConnectionString(
string jdbcConnectionString,
Dictionary<string, string>? discreteValues = null
)
Public Function ParseJdbcConnectionString (
jdbcConnectionString As String,
Optional discreteValues As Dictionary(Of String, String) = Nothing
) As ParameterValueCollection
public:
ParameterValueCollection^ ParseJdbcConnectionString(
String^ jdbcConnectionString,
Dictionary<String^, String^>^ discreteValues = nullptr
)
member ParseJdbcConnectionString :
jdbcConnectionString : string *
?discreteValues : Dictionary<string, string>
(* Defaults:
let _discreteValues = defaultArg discreteValues null
*)
-> ParameterValueCollection
Parameters
- jdbcConnectionString
- Type: SystemString
The JDBC connection string to parse. The string must follow the format specific to the JDBC provider, such
as "jdbc:sqlserver://localhost:1433;databaseName=TestDB;user=sa;password=your_password;encrypt=true;" or
"jdbc:postgresql://localhost:5432/TestDB?user=sa&password=your_password&ssl=true". - discreteValues (Optional)
- Type: System.Collections.GenericDictionaryString, String
A dictionary of additional values that are not part of jdbcConnectionString.
Return Value
Type:
ParameterValueCollectionA
ParameterValueCollection containing the extracted parameter values, such as host, port,
database name, and any additional provider-specific parameters.
Exceptions| Exception | Condition |
|---|
| ArgumentException | Thrown if jdbcConnectionString is null, empty, or does not match the expected JDBC
connection string format. |
| InvalidOperationException | Thrown if the JDBC parameter separator is not defined for the provider and the connection string contains
parameters. |
RemarksThis method validates the format of the provided JDBC connection string and extracts
key-value pairs based on the provider's expected format. If the connection string contains parameters, they
are resolved against the provider's property descriptors. The last occurrence of a parameter takes
precedence if duplicates are found.
See Also