Retrieves the mysql engine name.<p>

@param dbPoolData the database pool data
431981
protected void getMySqlEngine(Map<String, String> dbPoolData) {

        String engine = "MYISAM";
        CmsSetupDb setupDb = new CmsSetupDb(null);
        CmsSetupDBWrapper db = null;
        try {
            setupDb.setConnection(
                dbPoolData.get("driver"),
                dbPoolData.get("url"),
                dbPoolData.get("params"),
                dbPoolData.get("user"),
                dbPoolData.get("pwd"));

            db = setupDb.executeSqlStatement("SHOW TABLE STATUS LIKE 'CMS_GROUPS';", null);
            if (db.getResultSet().next()) {
                engine = db.getResultSet().getString("Engine").toUpperCase();
            }

        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            if (db != null) {
                db.close();
            }
            setupDb.closeConnection();
        }
        dbPoolData.put("engine", engine);
        System.out.println("Table engine:               " + engine);
    }
1225753
private String determineDatabaseProductName(Connection conn) {
        try {
            final String databaseProductName = conn.getMetaData().getDatabaseProductName().toLowerCase();
            LOGGER.debug("Database product: {}", databaseProductName);
            return databaseProductName;
        } catch (SQLException se) {
            LOGGER.warn("Problem determining database product!", se);
            return null;
        }
    }
741589
public void setDriverClassName(String driverClassName) {

        if (driverClassName.equals(JDBCConnectionPoolDataSource.driver)) {
            return;
        }

        /** @todo: Use a HSQLDB RuntimeException subclass */
        throw new RuntimeException("This class only supports JDBC driver '"
                                   + JDBCConnectionPoolDataSource.driver
                                   + "'");
    }
520632
@Override
	public String onTableName(String tableName) {
		if (onlyBindParameter)
			return null;

		if (currentSchema != null) {
			Finder<SQLProperty> finder = currentSchema.getEntityBySimpleName(tableName);
			AssertKripton.assertTrueOrUnknownClassInJQLException(finder != null, currentMethod, tableName);
			return finder.getTableName();
		} else {
			return null;
		}
	}
985762
protected void getOracleTablespaces(Map<String, String> dbPoolData) {

        String dataTablespace = "users";
        String indexTablespace = "users";
        CmsSetupDb setupDb = new CmsSetupDb(null);

        try {
            setupDb.setConnection(
                dbPoolData.get("driver"),
                dbPoolData.get("url"),
                dbPoolData.get("params"),
                dbPoolData.get("user"),
                dbPoolData.get("pwd"));

            // read tablespace for data
            CmsSetupDBWrapper db = null;
            try {
                db = setupDb.executeSqlStatement("SELECT DISTINCT tablespace_name FROM user_tables", null);
                if (db.getResultSet().next()) {
                    dataTablespace = db.getResultSet().getString(1).toLowerCase();
                }
            } finally {
                if (db != null) {
                    db.close();
                }
            }
            // read tablespace for indexes
            try {
                db = setupDb.executeSqlStatement("SELECT DISTINCT tablespace_name FROM user_indexes", null);
                if (db.getResultSet().next()) {
                    indexTablespace = db.getResultSet().getString(1).toLowerCase();
                }
            } finally {
                if (db != null) {
                    db.close();
                }
            }
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            setupDb.closeConnection();
        }

        dbPoolData.put("indexTablespace", indexTablespace);
        System.out.println("Index Tablespace:           " + indexTablespace);

        dbPoolData.put("dataTablespace", dataTablespace);
        System.out.println("Data Tablespace:            " + dataTablespace);
    }
392190
public String getDatabaseName(String databaseKey) {

        return getDatabaseProperties().get(databaseKey).getProperty(databaseKey + PROPKEY_NAME);
    }
1314810
protected String determineDatabaseType() throws HandlerException {
        String dbName = null;
        try (Connection conn = getConnection()) {
            dbName = conn.getMetaData().getDatabaseProductName();
        } catch (SQLException e) {
            throw new HandlerException("Exception occured while getting DB Name",
                    DatabaseAuditHandler.class, e);
        }
        return dbName;
    }
165908
@Override
	@Deprecated
	public DataSource dataSourceByName(String dbName) {
		return new com.danidemi.jlubricant.embeddable.BasicDataSource(
				dbByName(dbName));
	}
646658
public static AzkabanDataSource getMySQLDataSource(final String host, final Integer port,
      final String dbName, final String user, final String password, final Integer numConnections) {
    return new MySQLBasicDataSource(host, port, dbName, user, password,
        numConnections);
  }
527935
public function getTableName(
        string $modelEntity,
        string $connectionName = ResourceConnection::DEFAULT_CONNECTION
    ): string {
        return $this->resourceConnection->getTableName($modelEntity, $connectionName);
    }
1236015
public static String getDBTableSuffix(WorkspaceEntry wsConfig)
   {
      String defaultSuffix = replaceIncorrectChars(wsConfig.getName());

      String suffix =
         wsConfig.getContainer().getParameterValue(JDBCWorkspaceDataContainer.DB_TABLENAME_SUFFIX, defaultSuffix);
      return suffix;
   }
1171475
public void updateDatabase(String pool) {

        Map<String, String> dbPoolData = new HashMap<String, String>(m_dbPools.get(pool));

        // display info
        System.out.println("JDBC Driver:                " + getDbDriver(pool));
        System.out.println("JDBC Connection Url:        " + getDbUrl(pool));
        System.out.println("JDBC Connection Url Params: " + getDbParams(pool));
        System.out.println("Database User:              " + getDbUser(pool));

        // get the db implementation name
        String dbName = getDbName();
        String name = null;
        if (dbName.indexOf("mysql") > -1) {
            getMySqlEngine(dbPoolData);
            name = "mysql";
        } else if (dbName.indexOf("oracle") > -1) {
            getOracleTablespaces(dbPoolData);
            name = "oracle";
        } else if (dbName.indexOf("postgresql") > -1) {
            getPostgreSqlTablespaces(dbPoolData);
            name = "postgresql";
        } else {
            System.out.println("db " + dbName + " not supported");
            return;
        }

        // execute update
        Iterator<I_CmsUpdateDBPart> it = m_plugins.iterator();
        while (it.hasNext()) {
            I_CmsUpdateDBPart updatePart = it.next();
            I_CmsUpdateDBPart dbUpdater = getInstanceForDb(updatePart, name);
            if (dbUpdater != null) {
                dbUpdater.execute(dbPoolData);
            }
        }
    }
1263283
public String getDbWorkConStr() {

        if (m_provider.equals(POSTGRESQL_PROVIDER)) {
            return getDbProperty(m_databaseKey + ".constr.newDb");
        } else {
            return getExtProperty(CmsDbPoolV11.KEY_DATABASE_POOL + '.' + getPool() + ".jdbcUrl");
        }
    }
689193
private String extractDaoFieldNameForInternalDataSource(SQLiteDaoDefinition dao) {
		return "_" + CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL, dao.getName());
	}
437813
private static String getSourceNameParameter(WorkspaceEntry wsEntry) throws DBCleanException
   {
      try
      {
         return wsEntry.getContainer().getParameterValue(JDBCWorkspaceDataContainer.SOURCE_NAME);
      }
      catch (RepositoryConfigurationException e)
      {
         throw new DBCleanException(e);
      }
   }
991949
@Override
	public String getTagName(long jobExecutionId) {
		logger.entering(CLASSNAME, "getTagName", jobExecutionId);
		String apptag = null;
		Connection conn = null;
		PreparedStatement statement = null;
		ResultSet rs = null;
		String query = "SELECT A.apptag FROM jobinstancedata A INNER JOIN executioninstancedata B ON A.jobinstanceid = B.jobinstanceid"
				+ " WHERE B.jobexecid = ?";
		try {
			conn = getConnection();
			statement = conn.prepareStatement(query);
			statement.setLong(1, jobExecutionId);
			rs = statement.executeQuery();
			if(rs.next()) {
				apptag = rs.getString(1);
			}
		} catch (SQLException e) {
			throw new PersistenceException(e);
		} finally {
			cleanupConnection(conn, rs, statement);
		}
		logger.exiting(CLASSNAME, "getTagName");
		return apptag;
	}
572489
public static MySqlConnectionPoolBuilder newBuilder(final String connectionString, final String username) {
    final String[] arr = connectionString.split(":");
    final String host = arr[0];
    final int port = Integer.parseInt(arr[1]);
    return newBuilder(host, port, username);
  }