code: public static Dialect guessDialect(Connection jdbcConnection) {
  		String databaseName;
  		String driverName;
  		int majorVersion;
  		int minorVersion;
  		try {
  			DatabaseMetaData meta = jdbcConnection.getMetaData();
  			driverName = meta.getDriverName();
  			databaseName = meta.getDatabaseProductName();
  			majorVersion = meta.getDatabaseMajorVersion();
  			minorVersion = meta.getDatabaseMinorVersion();
  		} catch (SQLException e) {
  			return (Dialect) DialectException.throwEX(e);
  		}
  		return guessDialect(driverName, databaseName, majorVersion, minorVersion);
  	}
docs: Guess dialect based on given JDBC connection instance, Note: this method does
  not close connection
  
  @param jdbcConnection
  The connection
  @return dialect or null if can not guess out which dialect