setProperty

fun setProperty(key: String, value: String)

Sets one property by name, using the same names a JDBC URL would.

Names are matched case-insensitively, and several have aliases - host for serverName, port for portNumber, database for databaseName. A name that matches nothing goes to additionalProperties and reaches the server as a startup parameter, so a typo in a known name is not rejected here; it becomes a startup parameter and the server complains instead.

A value that will not parse as the property's type is refused, naming the property and the value. Nothing is guessed and nothing quietly falls back to a default: a misspelled sslmode would otherwise verify nothing, and a socketTimeout written 30s would wait forever - both silently, and both a long way from the line that caused them.

Parameters

key

The property name.

value

The value, as a string.

Throws

INVALID_ARGUMENT if value does not parse as the type of a recognized key.