- Author:
- Lukas Eder
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull SQLDialectdialect(io.r2dbc.spi.Connection connection)"Guess" theSQLDialectfrom an R2DBCConnectioninstance.static @NotNull SQLDialectdialect(io.r2dbc.spi.ConnectionFactory connection)"Guess" theSQLDialectfrom aConnectionFactoryinstance.static @NotNull SQLDialect"Guess" theSQLDialectfrom a connection URL.static @NotNull SQLDialectdialect(Connection connection)"Guess" theSQLDialectfrom aConnectioninstance.static @NotNull String"Guess" the JDBC driver from a connection URL.static @NotNull Stringdriver(SQLDialect dialect)"Guess" the JDBC driver from aSQLDialect.static voidSafely close a closeable.static voidsafeClose(AutoCloseable closeable)Safely close a closeable.static voidsafeClose(Connection connection)Safely close a connection.static voidSafely close a result set.static voidsafeClose(ResultSet resultSet, PreparedStatement statement)Safely close a result set and / or a statement.static voidSafely close a statement.static voidSafely free an Array object.static voidSafely free a blob.static voidSafely free a clob.static voidSafely free an XML object.static BooleanwasNull(CallableStatement statement, Boolean value)Convenient way to check if a JDBC-originated record wasnull.static <T> TwasNull(CallableStatement statement, T value)Convenient way to check if a JDBC-originated record wasnull.static BooleanConvenient way to check if a JDBC-originated record wasnull.static <T> TConvenient way to check if a JDBC-originated record wasnull.static BooleanConvenient way to check if a JDBC-originated record wasnull.static <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(String)
-
dialect
@NotNull public static final @NotNull SQLDialect dialect(io.r2dbc.spi.ConnectionFactory connection)"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(String)
-
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(String)
-
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 SQLExceptionConvenient 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 Boolean wasNull(CallableStatement statement, Boolean value) throws SQLExceptionConvenient 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
-