Code example for DatabaseMetaData

Methods: getDatabaseMajorVersiongetDatabaseProductName

0
			throw new HibernateException( "Connection cannot be null when 'hibernate.dialect' not set" ); 
		} 
 
		try { 
			final DatabaseMetaData databaseMetaData = connection.getMetaData();
			final Dialect dialect = dialectResolver.resolveDialect( databaseMetaData );
 
			if ( dialect == null ) {
				throw new HibernateException( 
						"Unable to determine Dialect to use [name=" + databaseMetaData.getDatabaseProductName() +
								", majorVersion=" + databaseMetaData.getDatabaseMajorVersion() +
								"]; user must register resolver or explicitly set 'hibernate.dialect'" 
				); 
			} 
 
			return dialect;
		} 
		catch ( SQLException sqlException ) {
			throw new HibernateException( 
					"Unable to access java.sql.DatabaseMetaData to determine appropriate Dialect to use", 
Stop searching for code, let great code find you!  Add Codota to your java IDE