Java Code Examples for org.hibernate.engine.jdbc.dialect.spi.DatabaseMetaDataDialectResolutionInfoAdapter

The following examples show how to use org.hibernate.engine.jdbc.dialect.spi.DatabaseMetaDataDialectResolutionInfoAdapter. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: score   Source File: ScoreDialectResolver.java    License: Apache License 2.0 5 votes vote down vote up
protected Dialect resolveDialectInternal(DatabaseMetaData metaData) throws SQLException {
     String databaseName = metaData.getDatabaseProductName();
     int databaseMajorVersion = metaData.getDatabaseMajorVersion();

     logger.info("Database name is: " + databaseName + " databaseMajorVersion is: " + databaseMajorVersion);
     
     if ( "MySQL".equals( databaseName ) ) {
return new ScoreMySQLDialect();
     }
     DatabaseMetaDataDialectResolutionInfoAdapter databaseMetaDataDialectResolutionInfoAdapter=new DatabaseMetaDataDialectResolutionInfoAdapter(metaData);
     return resolveDialect(databaseMetaDataDialectResolutionInfoAdapter);
 }
 
Example 2
Source Project: pnc   Source File: DefaultSequenceHandlerRepository.java    License: Apache License 2.0 4 votes vote down vote up
public DatabaseMetaDataDialectResolutionInfoAdapter getResolutionInfo(Connection connection) throws SQLException {
    return new DatabaseMetaDataDialectResolutionInfoAdapter(connection.getMetaData());
}