Code example for DatabaseMetaData

Methods: getDatabaseMajorVersiongetDatabaseProductName

0
		this.matchingVersion = matchingVersion;
		this.dialectClass = dialectClass;
	} 
 
	protected final Dialect resolveDialectInternal(DatabaseMetaData metaData) throws SQLException {
		final String databaseName = metaData.getDatabaseProductName();
		final int databaseMajorVersion = metaData.getDatabaseMajorVersion();
 
		if ( matchingName.equalsIgnoreCase( databaseName )
				&& ( matchingVersion == VERSION_INSENSITIVE_VERSION || matchingVersion == databaseMajorVersion ) ) {
			try { 
				return ( Dialect ) dialectClass.newInstance();
			} 
			catch ( HibernateException e ) {
				// conceivable that the dialect ctor could throw HibernateExceptions, so don't re-wrap 
				throw e;
			} 
			catch ( Throwable t ) {
				throw new HibernateException( 
						"Could not instantiate specified Dialect class [" + dialectClass.getName() + "]",
						t