| Modifier and Type | Method and Description |
|---|---|
static String |
extendReturning(String sql,
String returning)
Extends a SQL statement with
RETURNING clause. |
static String |
lockWaitTimeoutStatement(Duration timeout)
Generates a statement to set the lock wait timeout for the current session.
|
static ZoneId |
parseZoneId(String zoneId)
Parses a normalized
ZoneId from a time zone string of MySQL. |
static String |
quoteIdentifier(String identifier)
Quotes identifier with backticks, it will escape backticks in the identifier.
|
static String |
statementTimeoutVariable(Duration timeout,
boolean isMariaDb)
Generates a
String indicating the statement timeout variable. |
public static String quoteIdentifier(String identifier)
identifier - the identifierpublic static String extendReturning(String sql, String returning)
RETURNING clause.sql - the original SQL statement.returning - quoted column identifiers.RETURNING clause.public static String statementTimeoutVariable(Duration timeout, boolean isMariaDb)
String indicating the statement timeout variable. e.g. "max_statement_time=1.5" for
MariaDB or "max_execution_time=1500" for MySQL.timeout - the statement timeoutisMariaDb - whether the current server is MariaDBpublic static String lockWaitTimeoutStatement(Duration timeout)
innodb_lock_wait_timeout.timeout - the lock wait timeoutpublic static ZoneId parseZoneId(String zoneId)
ZoneId from a time zone string of MySQL.
Note: since java 14.0.2, 11.0.8, 8u261 and 7u271, America/Nuuk is already renamed from America/Godthab. See also tzdata2020a
zoneId - the time zone stringZoneIdIllegalArgumentException - if the time zone string is null or emptyDateTimeException - if the time zone string has an invalid formatZoneRulesException - if the time zone string cannot be foundCopyright © 2018–2024 asyncer.io. All rights reserved.