Class DbConnectionConfig.Builder
- Enclosing class:
DbConnectionConfig
DbConnectionConfig.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Validates required connection fields and builds the immutable config.dbPassword(String dbPassword) Sets the database password.Sets the database username.jdbcProperties(Properties jdbcProperties) Sets additional JDBC properties to use when creating the database connection throughDriverManager.Sets an explicit JDBC URL.walletPassword(String walletPassword) Sets the password for a password-protected wallet.
-
Method Details
-
dbUser
Sets the database username.- Parameters:
dbUser- database username- Returns:
- this builder instance
-
dbPassword
Sets the database password.- Parameters:
dbPassword- database password- Returns:
- this builder instance
-
walletPassword
Sets the password for a password-protected wallet.The SDK passes this value to Oracle JDBC as
oracle.net.wallet_password; it is not appended to the JDBC URL.- Parameters:
walletPassword- wallet password, required only for password-protected wallets- Returns:
- this builder instance
-
jdbcUrl
Sets an explicit JDBC URL.Supported URL forms include Oracle JDBC Thin Easy Connect/Easy Connect Plus, TNS aliases, full connection descriptors, TCPS configurations, and wallet/TNS_ADMIN based Autonomous Database URLs. This builder validates only the SDK-owned minimum contract: the URL must be an Oracle Thin JDBC URL with a non-blank connect target after
@. Driver-level network, wallet, TLS, Kerberos, RADIUS, and token-authentication requirements are validated by Oracle JDBC and the database environment.- Parameters:
jdbcUrl- full JDBC URL- Returns:
- this builder instance
-
jdbcProperties
Sets additional JDBC properties to use when creating the database connection throughDriverManager.The supplied properties are validated and defensively copied so that subsequent modifications to the caller's
Propertiesinstance do not affect this configuration. IfjdbcPropertiesisnull, an empty set of JDBC properties is used.The SDK owns the
userandpasswordproperties fromdbUser(String)anddbPassword(String). Supplying those keys through this method is rejected. Other driver-specific property names and values are passed through to Oracle JDBC for validation. Do not log properties that contain sensitive values.- Parameters:
jdbcProperties- additional JDBC connection properties, ornullto use no additional properties- Returns:
- this builder instance
- Throws:
IllegalArgumentException- if the supplied properties contain blank property names or SDK-owneduserorpasswordkeys
-
build
Validates required connection fields and builds the immutable config.- Returns:
- immutable DbConnectionConfig built from validated builder state
-