Top Description Fields Constructors Methods
org.hibernate.engine.jdbc

public Class JdbcSupportLoader

extends Object
Class Inheritance
Imports
java.sql.Connection, .SQLException, .DatabaseMetaData, java.lang.reflect.Method, org.slf4j.Logger, .LoggerFactory

Builds JdbcSupport instances based on the capabilities of the environment.
Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private static final Logger
private static final Class<T>[]
private static final Object[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static JdbcSupport

Returns:

An appropriate JdbcSupport instance.
loadJdbcSupport
(Connection
A JDBC java.sql.Connection which can be used to gauge the drivers level of support, specifically for creating LOB references.
jdbcConnection
)

The public factory method for obtaining the appropriate (according to given JDBC java.sql.Connection) JdbcSupport.

private static boolean

Returns:

True if the connection can be used to create LOBs; false otherwise.
useContextualLobCreation
(Connection
The connection which can be used in level-of-support testing.
jdbcConnection
)

Basically here we are simply checking whether we can call the Connection methods for LOB creation added in JDBC 4.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

logback to summary
private static final Logger log
NO_ARG_SIGback to summary
private static final Class<T>[] NO_ARG_SIG
NO_ARGSback to summary
private static final Object[] NO_ARGS

Constructor Detail

JdbcSupportLoaderback to summary
public JdbcSupportLoader()

Method Detail

loadJdbcSupportback to summary
public static JdbcSupport loadJdbcSupport(Connection jdbcConnection)

The public factory method for obtaining the appropriate (according to given JDBC java.sql.Connection) JdbcSupport.

Parameters
jdbcConnection:Connection

A JDBC java.sql.Connection which can be used to gauge the drivers level of support, specifically for creating LOB references.

Returns:JdbcSupport

An appropriate JdbcSupport instance.

useContextualLobCreationback to summary
private static boolean useContextualLobCreation(Connection jdbcConnection)

Basically here we are simply checking whether we can call the Connection methods for LOB creation added in JDBC 4. We not only check whether the Connection declares these methods, but also whether the actual Connection instance implements them (i.e. can be called without simply throwing an exception).

Parameters
jdbcConnection:Connection

The connection which can be used in level-of-support testing.

Returns:boolean

True if the connection can be used to create LOBs; false otherwise.