Invokes {@link DatabaseMetaData#getTableTypes()} and returns bound information.

@return a list of table types
@throws SQLException if a database error occurs.
193069
public List<TableType> getTableTypes() throws SQLException {
        final List<TableType> list = new ArrayList<>();
        try (ResultSet results = databaseMetadata.getTableTypes()) {
            if (results != null) {
                bind(results, TableType.class, list);
            }
        }
        return list;
    }
610866
public Collection<String> listColumns(String table) throws SQLException {
	Collection<String> result = new ArrayList<String>();
	DatabaseMetaData dbm = connection.getMetaData();
	ResultSet rs = dbm.getColumns(null, null, table, null);
	while (rs.next()) {
	    result.add(rs.getString("COLUMN_NAME"));
	}
	return result;
    }
248813
public List<String> getFeatureTables() throws SQLException {

		List<String> tableNames = new ArrayList<String>();

		List<GeometryColumns> geometryColumns = queryForAll();
		for (GeometryColumns geometryColumn : geometryColumns) {
			tableNames.add(geometryColumn.getTableName());
		}

		return tableNames;
	}
375034
protected void getFieldMappings()
            throws SQLException {

        final String[] keys = getKeysFromResultSet();

        //
        // find fields or setters for return class
        //
        HashMap<String, AccessibleObject> mapFields = new HashMap<String, AccessibleObject>(_columnCount * 2);
        for (int i = 1; i <= _columnCount; i++) {
            mapFields.put(keys[i], null);
        }

        // public methods
        Method[] classMethods = _returnTypeClass.getMethods();
        for (Method m : classMethods) {

            if (isSetterMethod(m)) {
                final String fieldName = m.getName().substring(3).toUpperCase();
                if (mapFields.containsKey(fieldName)) {

                    // check for overloads
                    Object field = mapFields.get(fieldName);
                    if (field == null) {
                        mapFields.put(fieldName, m);
                    } else {
                        throw new ControlException("Unable to choose between overloaded methods " + m.getName()
                                                   + " on the " + _returnTypeClass.getName() + " class. Mapping is done using "
                                                   + "a case insensitive comparision of SQL ResultSet columns to field "
                                                   + "names and public setter methods on the return class.");
                    }
                }
            }
        }

        // fix for 8813: include inherited and non-public fields
        for (Class clazz = _returnTypeClass; clazz != null && clazz != Object.class; clazz = clazz.getSuperclass()) {
            Field[] classFields = clazz.getDeclaredFields();
            for (Field f : classFields) {
                if (Modifier.isStatic(f.getModifiers())) continue;
                if (!Modifier.isPublic(f.getModifiers())) continue;
                String fieldName = f.getName().toUpperCase();
                if (!mapFields.containsKey(fieldName)) continue;

                Object field = mapFields.get(fieldName);
                if (field == null) {
                    mapFields.put(fieldName, f);
                }
            }
        }

        // finally actually init the fields array
        _fields = new AccessibleObject[_columnCount + 1];
        _fieldTypes = new int[_columnCount + 1];

        for (int i = 1; i < _fields.length; i++) {
            AccessibleObject f = mapFields.get(keys[i]);
            if (f == null) {
                throw new ControlException("Unable to map the SQL column " + keys[i]
                                           + " to a field on the " + _returnTypeClass.getName() +
                                           " class. Mapping is done using a case insensitive comparision of SQL ResultSet "
                                           + "columns to field names and public setter methods on the return class.");
            }

            _fields[i] = f;
            if (f instanceof Field) {
                _fieldTypes[i] = _tmf.getTypeId(((Field) f).getType());
            } else {
                _fieldTypes[i] = _tmf.getTypeId(((Method) f).getParameterTypes()[0]);
            }
        }
    }
1177307
@Override
	public synchronized List<RecordSessionUrl> getUrlsForType (int type) throws DatabaseException {
    	try {
			psGetAlluRLSForType.setInt(1, type);
			try (ResultSet rs = psGetAlluRLSForType.executeQuery()) {
				List<RecordSessionUrl> result = new ArrayList<>();
				while (rs.next()) {
					result.add(new RecordSessionUrl(rs.getLong(URLID), rs.getInt(TYPE), rs.getString(URL)));
				}
				return result;
			}
		} catch (SQLException e) {
			throw new DatabaseException(e);
		}
    }
125187
public List<SqlResultSetMapping<EntityMappings<T>>> getAllSqlResultSetMapping()
   {
      List<SqlResultSetMapping<EntityMappings<T>>> list = new ArrayList<SqlResultSetMapping<EntityMappings<T>>>();
      List<Node> nodeList = childNode.get("sql-result-set-mapping");
      for(Node node: nodeList)
      {
         SqlResultSetMapping<EntityMappings<T>>  type = new SqlResultSetMappingImpl<EntityMappings<T>>(this, "sql-result-set-mapping", childNode, node);
         list.add(type);
      }
      return list;
   }
908113
@Override
  public Map<String, JdbcType> retrieveDateColumns(String database, String table)
      throws SQLException {
    Map<String, JdbcType> targetDataTypes =
        ImmutableMap.<String, JdbcType>builder().put("DATE", JdbcType.DATE).put("TIME WITH TIME ZONE", JdbcType.TIME)
            .put("TIME WITHOUT TIME ZONE", JdbcType.TIME).put("TIMESTAMP WITH TIME ZONE", JdbcType.TIMESTAMP)
            .put("TIMESTAMP WITHOUT TIME ZONE", JdbcType.TIMESTAMP).build();

    ImmutableMap.Builder<String, JdbcType> dateColumnsBuilder = ImmutableMap.builder();

    try (PreparedStatement pstmt = this.conn
        .prepareStatement(INFORMATION_SCHEMA_SELECT_SQL_PSTMT, ResultSet.TYPE_SCROLL_INSENSITIVE,
            ResultSet.CONCUR_READ_ONLY)) {
      pstmt.setString(1, database);
      pstmt.setString(2, table);
      log.info("Retrieving column type information from SQL: " + pstmt);
      try (ResultSet rs = pstmt.executeQuery()) {
        if (!rs.first()) {
          throw new IllegalArgumentException("No result from information_schema.columns");
        }
        do {
          String type = rs.getString("data_type").toUpperCase();
          JdbcType convertedType = targetDataTypes.get(type);
          if (convertedType != null) {
            dateColumnsBuilder.put(rs.getString("column_name"), convertedType);
          }
        } while (rs.next());
      }
    }
    return dateColumnsBuilder.build();
  }
1263614
protected List<SqlConfInfo> getSqlConfInfos() {
        List<SqlConfInfo> packInfos = newArrayList();
        PathMatchingResourcePatternResolver o = new PathMatchingResourcePatternResolver();

        try {
            Resource packInfosAsResource[] = o.getResources("classpath*:sqlconf/*/00-info.txt");
            for (Resource r : packInfosAsResource) {
                packInfos.add(new SqlConfInfo(r));
            }

            Collections.sort(packInfos);
            return packInfos;
        } catch (IOException ioe) {
            throw new RuntimeException("Error while searching for SQL CONF having a sqlconf/*/00-info.txt file!", ioe);
        }
    }
1364705
public java.util.List<String> getInstanceGroupTypes() {
        if (instanceGroupTypes == null) {
            instanceGroupTypes = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return instanceGroupTypes;
    }
1156764
public List<ClientInfoProperty> getClientInfoProperties() throws SQLException {
        final List<ClientInfoProperty> list = new ArrayList<>();
        try (ResultSet results = databaseMetadata.getClientInfoProperties()) {
            if (results != null) {
                bind(results, ClientInfoProperty.class, list);
            }
        }
        return list;
    }
204134
public List<ExtendedRelation> getTableRelations(String table)
			throws SQLException {

		QueryBuilder<ExtendedRelation, Long> qb = queryBuilder();
		qb.where().like(ExtendedRelation.COLUMN_BASE_TABLE_NAME, table).or()
				.like(ExtendedRelation.COLUMN_RELATED_TABLE_NAME, table);
		PreparedQuery<ExtendedRelation> preparedQuery = qb.prepare();

		return query(preparedQuery);
	}
869223
public List<String> getTables(String dataType) throws SQLException {
		List<Contents> contents = getContents(dataType);
		List<String> tableNames = new ArrayList<String>();
		for (Contents content : contents) {
			tableNames.add(content.getTableName());
		}
		return tableNames;
	}
1323926
public List<D6TableMetaInfo> getTablesInfo(DBConnInfo dbConnInfo) {

		final List<D6TableMetaInfo> retTablesInfo = new ArrayList<D6TableMetaInfo>();

		final Connection conn = new DBConnCreator(dbConnInfo).createDBConnection();

		final List<String> tableList = new ArrayList<String>();

		ResultSet rs = null;

		try {
			final DatabaseMetaData metaData = conn.getMetaData();

			rs = metaData.getTables(null, null, "%", new String[] { "TABLE" });

			try {
				while (rs.next()) {
					final String tableName = rs.getString("TABLE_NAME");
					tableList.add(tableName);
				}
			} finally {
				rs.close();
			}

			for (String tableName : tableList) {

				final D6TableMetaInfo tableInfo = new D6TableMetaInfo();

				tableInfo.tableName = tableName;

				final Map<String, D6ColumnMetaInfo> colInfoMap = new LinkedHashMap<String, D6ColumnMetaInfo>();

				rs = metaData.getColumns(null, null, tableName, null);

				try {
					while (rs.next()) {
						D6ColumnMetaInfo colMeta = new D6ColumnMetaInfo();
						colMeta.columnName = rs.getString("COLUMN_NAME");
						colMeta.typeName = rs.getString("TYPE_NAME");
						colMeta.columnSize = rs.getInt("COLUMN_SIZE");
						colMeta.isNullable = "YES".equals(rs.getString("IS_NULLABLE"));
						colMeta.isAutoIncrement = "YES".equals("IS_AUTOINCREMENT");
						// java.sql.Types
						colMeta.dataType = rs.getInt("DATA_TYPE");

						colInfoMap.put(colMeta.columnName, colMeta);
					}
				} finally {
					rs.close();
				}

				rs = metaData.getPrimaryKeys(null, null, tableName);

				try {
					while (rs.next()) {
						final String columnName = rs.getString("COLUMN_NAME");
						final String pkName = rs.getString("PK_NAME");
						final short primaryKeySequentialIndex = rs.getShort("KEY_SEQ");

						final D6ColumnMetaInfo colMeta = colInfoMap.get(columnName);
						if (colMeta != null) {
							colMeta.pkName = pkName;
							colMeta.isPrimaryKey = true;
							colMeta.primaryKeySeqNum = primaryKeySequentialIndex;
						}

					}
				} finally {
					rs.close();
				}

				final Statement stmt = conn.createStatement();

				try {

					rs = stmt.executeQuery("SELECT * FROM " + tableName + " WHERE 0=1");
					try {
						ResultSetMetaData rmd = rs.getMetaData();
						for (int i = 1; i <= rmd.getColumnCount(); i++) {
							String columnName = rmd.getColumnName(i);
							final D6ColumnMetaInfo colMeta = colInfoMap.get(columnName);
							if (colMeta != null) {
								colMeta.className = rmd.getColumnClassName(i);
							}

						}
					} finally {
						rs.close();
					}
				} finally {
					stmt.close();
				}

				for (String columnName : colInfoMap.keySet()) {
					D6ColumnMetaInfo colMeta = colInfoMap.get(columnName);
					tableInfo.columnList.add(colMeta);
				}

				retTablesInfo.add(tableInfo);
			}

		} catch (SQLException e) {
			e.printStackTrace();
		} finally {
			try {
				conn.close();
			} catch (SQLException e) {
			}
		}
		return retTablesInfo;
	}
1266546
public Collection<DbAndTable> getTables() throws IOException {
    List<DbAndTable> tables = Lists.newArrayList();

    try (AutoReturnableObject<IMetaStoreClient> client = this.clientPool.getClient()) {
      Iterable<String> databases = Iterables.filter(client.get().getAllDatabases(), new Predicate<String>() {
        @Override
        public boolean apply(String db) {
          return HiveDatasetFinder.this.whitelistBlacklist.acceptDb(db);
        }
      });
      for (final String db : databases) {

        Iterable<String> tableNames = Iterables.filter(client.get().getAllTables(db), new Predicate<String>() {
          @Override
          public boolean apply(String table) {
            return HiveDatasetFinder.this.whitelistBlacklist.acceptTable(db, table);
          }
        });
        for (String tableName : tableNames) {
          tables.add(new DbAndTable(db, tableName));
        }
      }
    } catch (Exception exc) {
      throw new IOException(exc);
    }

    return tables;
  }
885561
static public List<ColumnMetaData> createList(ResultSetMetaData m) throws SQLException{
		List<ColumnMetaData> result = new ArrayList<ColumnMetaData>(m.getColumnCount());
		for (int i = 1; i <= m.getColumnCount(); i ++){
			ColumnMetaData cm = new ColumnMetaData(m, i);
			result.add(cm);
		}
		return result;
	}
1063161
public static List<CreateTableResult> initAllTables() {
        final List<CreateTableResult> ret = new ArrayList<>();
        final List<RepositoryDefinition> repositoryDefs = getRepositoryDefinitions();
        boolean isSuccess = false;
        for (final RepositoryDefinition repositoryDef : repositoryDefs) {
            try {
                isSuccess = JdbcFactory.getInstance().createTable(repositoryDef);
            } catch (final SQLException e) {
                LOGGER.log(Level.ERROR, "Creates table [" + repositoryDef.getName() + "] error", e);
            }

            ret.add(new CreateTableResult(repositoryDef.getName(), isSuccess));
        }

        return ret;
    }
990013
public String[] getTypes() {
        String[] types = new String[columns.getColumns().size()];
        for (int i = 0; i < columns.getColumns().size(); i++) {
            types[i] = columns.getColumns().get(i).getType();
        }
        return types;
    }