- Author:
- Lukas Eder
-
Method Summary
Modifier and TypeMethodDescriptionstatic final @NotNull SQLDialectdialect(io.r2dbc.spi.Connection connection) "Guess" theSQLDialectfrom an R2DBCConnectioninstance.static final @NotNull SQLDialectdialect(io.r2dbc.spi.ConnectionFactory connection) "Guess" theSQLDialectfrom aConnectionFactoryinstance.static final @NotNull SQLDialect"Guess" theSQLDialectfrom a connection URL.static final @NotNull SQLDialectdialect(Connection connection) "Guess" theSQLDialectfrom aConnectioninstance.static final @NotNull String"Guess" the JDBC driver from a connection URL.static final @NotNull Stringdriver(SQLDialect dialect) "Guess" the JDBC driver from aSQLDialect.static final QOM.ForeignKeyRuleforeignKeyRule(int code) Translate theDatabaseMetaData.importedKeyCascadeand various other flag valuse to the jOOQQOM.ForeignKeyRulerepresentation.static final voidSafely close a closeable.static final voidsafeClose(AutoCloseable closeable) Safely close a closeable.static final voidsafeClose(Connection connection) Safely close a connection.static final voidSafely close a result set.static final voidsafeClose(ResultSet resultSet, PreparedStatement statement) Safely close a result set and / or a statement.static final voidSafely close a statement.static final voidSafely free an Array object.static final voidSafely free a blob.static final voidSafely free a clob.static final voidSafely free an XML object.static final BooleanwasNull(CallableStatement statement, Boolean value) Convenient way to check if a JDBC-originated record wasnull.static final <T> TwasNull(CallableStatement statement, T value) Convenient way to check if a JDBC-originated record wasnull.static final BooleanConvenient way to check if a JDBC-originated record wasnull.static final <T> TConvenient way to check if a JDBC-originated record wasnull.static final BooleanConvenient way to check if a JDBC-originated record wasnull.static final <T> TConvenient way to check if a JDBC-originated record wasnull.
-
Method Details
-
dialect
"Guess" theSQLDialectfrom aConnectioninstance.This method tries to guess the
SQLDialectof a connection from the its connection URL as obtained byDatabaseMetaData.getURL(). If the dialect cannot be guessed from the URL (e.g. when using an JDBC-ODBC bridge), further actions may be implemented in the future.- Returns:
- The appropriate
SQLDialectorSQLDialect.DEFAULTif no dialect could be derived from the connection. Nevernull. - See Also:
-
dialect
"Guess" theSQLDialectfrom aConnectionFactoryinstance.This method tries to guess the
SQLDialectof a connection from the itsConnectionFactoryMetadataas obtained byConnectionFactory.getMetadata(). If the dialect cannot be guessed, further actions may be implemented in the future.- Returns:
- The appropriate
SQLDialectorSQLDialect.DEFAULTif no dialect could be derived from the connection. Nevernull. - See Also:
-
dialect
"Guess" theSQLDialectfrom an R2DBCConnectioninstance.This method tries to guess the
SQLDialectof a connection from the itsConnectionMetadataas obtained byConnection.getMetadata(). If the dialect cannot be, further actions may be implemented in the future.- Returns:
- The appropriate
SQLDialectorSQLDialect.DEFAULTif no dialect could be derived from the connection. Nevernull. - See Also:
-
dialect
"Guess" theSQLDialectfrom a connection URL.- Returns:
- The appropriate
SQLDialectorSQLDialect.DEFAULTif no dialect could be derived from the connection. Nevernull.
-
driver
"Guess" the JDBC driver from aSQLDialect.- Returns:
- The appropriate JDBC driver class or
"java.sql.Driver"if no driver class could be derived from the URL. Nevernull.
-
driver
"Guess" the JDBC driver from a connection URL.- Returns:
- The appropriate JDBC driver class or
"java.sql.Driver"if no driver class could be derived from the URL. Nevernull.
-
safeClose
Safely close a connection.This method will silently ignore if
connectionisnull, or ifConnection.close()throws an exception. -
safeClose
Safely close a statement.This method will silently ignore if
statementisnull, or ifStatement.close()throws an exception. -
safeClose
Safely close a result set.This method will silently ignore if
resultSetisnull, or ifResultSet.close()throws an exception. -
safeClose
Safely close a result set and / or a statement.This method will silently ignore if
resultSetorstatementisnull, or ifResultSet.close()orStatement.close()throws an exception. -
safeClose
Safely close a closeable.This method will silently ignore if
closeableisnull, or ifCloseable.close()throws an exception. -
safeClose
Safely close a closeable.This method will silently ignore if
closeableisnull, or ifAutoCloseable.close()throws an exception. -
safeFree
Safely free a blob.This method will silently ignore if
blobisnull, or ifBlob.free()throws an exception. -
safeFree
Safely free a clob.This method will silently ignore if
clobisnull, or ifClob.free()throws an exception. -
safeFree
Safely free an XML object.This method will silently ignore if
xmlisnull, or ifSQLXML.free()throws an exception. -
safeFree
Safely free an Array object.This method will silently ignore if
arrayisnull, or ifArray.free()throws an exception. -
wasNull
Convenient way to check if a JDBC-originated record wasnull.This is useful to check if primitive types obtained from the JDBC API were actually SQL NULL values.
- Parameters:
stream- The data source from which a value was readvalue- The value that was read- Returns:
- The
valueornullif theSQLInput.wasNull()istrue - Throws:
SQLException
-
wasNull
Convenient way to check if a JDBC-originated record wasnull.This is useful to check if primitive types obtained from the JDBC API were actually SQL NULL values.
- Parameters:
stream- The data source from which a value was readvalue- The value that was read- Returns:
- The
valueornullif theSQLInput.wasNull()istrue - Throws:
SQLException
-
wasNull
Convenient way to check if a JDBC-originated record wasnull.This is useful to check if primitive types obtained from the JDBC API were actually SQL NULL values.
- Parameters:
stream- The data source from which a value was readvalue- The value that was read- Returns:
- The
valueornullif theSQLInput.wasNull()istrue - Throws:
SQLException
-
wasNull
Convenient way to check if a JDBC-originated record wasnull.This is useful to check if primitive types obtained from the JDBC API were actually SQL NULL values.
- Parameters:
rs- The data source from which a value was readvalue- The value that was read- Returns:
- The
valueornullif theResultSet.wasNull()istrue - Throws:
SQLException
-
wasNull
Convenient way to check if a JDBC-originated record wasnull.This is useful to check if primitive types obtained from the JDBC API were actually SQL NULL values.
- Parameters:
rs- The data source from which a value was readvalue- The value that was read- Returns:
- The
valueornullif theResultSet.wasNull()istrue - Throws:
SQLException
-
wasNull
Convenient way to check if a JDBC-originated record wasnull.This is useful to check if primitive types obtained from the JDBC API were actually SQL NULL values.
- Parameters:
rs- The data source from which a value was readvalue- The value that was read- Returns:
- The
valueornullif theResultSet.wasNull()istrue - Throws:
SQLException
-
wasNull
Convenient way to check if a JDBC-originated record wasnull.This is useful to check if primitive types obtained from the JDBC API were actually SQL NULL values.
- Parameters:
statement- The data source from which a value was readvalue- The value that was read- Returns:
- The
valueornullif theCallableStatement.wasNull()istrue - Throws:
SQLException
-
wasNull
public static final <T extends Number> T wasNull(CallableStatement statement, T value) throws SQLException Convenient way to check if a JDBC-originated record wasnull.This is useful to check if primitive types obtained from the JDBC API were actually SQL NULL values.
- Parameters:
statement- The data source from which a value was readvalue- The value that was read- Returns:
- The
valueornullif theCallableStatement.wasNull()istrue - Throws:
SQLException
-
wasNull
Convenient way to check if a JDBC-originated record wasnull.This is useful to check if primitive types obtained from the JDBC API were actually SQL NULL values.
- Parameters:
statement- The data source from which a value was readvalue- The value that was read- Returns:
- The
valueornullif theCallableStatement.wasNull()istrue - Throws:
SQLException
-
foreignKeyRule
Translate theDatabaseMetaData.importedKeyCascadeand various other flag valuse to the jOOQQOM.ForeignKeyRulerepresentation.
-