public class JdbcUtils extends Object
| Constructor and Description |
|---|
JdbcUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Map<String,Relation> |
fetchColumns(Connection conn) |
static Map<String,Relation> |
fetchColumns(Connection conn,
String schema,
String table) |
static Map<String,Relation> |
fetchColumns(DatabaseMetaData meta,
String catalog) |
static Map<String,Relation> |
fetchColumns(DatabaseMetaData meta,
String catalog,
String schema,
Iterable<String> tables) |
static Map<String,Relation> |
fetchColumns(DatabaseMetaData meta,
String catalog,
String schema,
String table) |
static com.google.common.collect.Multimap<String,ForeignKey> |
fetchForeignKeys(Connection conn) |
static com.google.common.collect.Multimap<String,ForeignKey> |
fetchForeignKeys(DatabaseMetaData meta,
String catalog) |
static com.google.common.collect.Multimap<String,ForeignKey> |
fetchForeignKeys(DatabaseMetaData meta,
String catalog,
String schema,
Iterable<String> tables) |
static com.google.common.collect.Multimap<String,ForeignKey> |
fetchForeignKeys(DatabaseMetaData meta,
String catalog,
String schema,
String table) |
static com.google.common.collect.Multimap<String,Index> |
fetchIndexes(DatabaseMetaData meta,
String catalog,
String schemaName,
Iterable<String> tableNames,
boolean unique) |
static com.google.common.collect.Multimap<String,Index> |
fetchIndexes(DatabaseMetaData meta,
String catalog,
String schemaName,
String tableName,
boolean unique) |
static com.google.common.collect.Multimap<String,Index> |
fetchIndexesUnsafe(DatabaseMetaData meta,
String catalog,
String schemaName,
String tableName,
boolean unique) |
static Map<String,PrimaryKey> |
fetchPrimaryKeys(Connection conn) |
static Map<String,PrimaryKey> |
fetchPrimaryKeys(DatabaseMetaData meta,
String catalog) |
static Map<String,PrimaryKey> |
fetchPrimaryKeys(DatabaseMetaData meta,
String catalog,
String schema,
Iterable<String> tables) |
static Map<String,PrimaryKey> |
fetchPrimaryKeys(DatabaseMetaData meta,
String catalog,
String schema,
String table) |
static Set<String> |
fetchRelationNames(Connection conn) |
static Set<String> |
fetchRelationNames(DatabaseMetaData meta,
String catalog)
For each table retrieve all columns and their foreign key relations
Retrieving foreign keys:
http://www.java2s.com/Code/Java/Database-SQL-JDBC/GetForeignKeys.htm
|
public static com.google.common.collect.Multimap<String,ForeignKey> fetchForeignKeys(Connection conn) throws SQLException
SQLExceptionpublic static com.google.common.collect.Multimap<String,ForeignKey> fetchForeignKeys(DatabaseMetaData meta, String catalog) throws SQLException
SQLExceptionpublic static com.google.common.collect.Multimap<String,ForeignKey> fetchForeignKeys(DatabaseMetaData meta, String catalog, String schema, Iterable<String> tables) throws SQLException
SQLExceptionpublic static com.google.common.collect.Multimap<String,ForeignKey> fetchForeignKeys(DatabaseMetaData meta, String catalog, String schema, String table) throws SQLException
SQLExceptionpublic static Map<String,PrimaryKey> fetchPrimaryKeys(Connection conn) throws SQLException
SQLExceptionpublic static Map<String,PrimaryKey> fetchPrimaryKeys(DatabaseMetaData meta, String catalog) throws SQLException
SQLExceptionpublic static Map<String,PrimaryKey> fetchPrimaryKeys(DatabaseMetaData meta, String catalog, String schema, Iterable<String> tables) throws SQLException
SQLExceptionpublic static Map<String,PrimaryKey> fetchPrimaryKeys(DatabaseMetaData meta, String catalog, String schema, String table) throws SQLException
SQLExceptionpublic static Set<String> fetchRelationNames(Connection conn) throws SQLException
SQLExceptionpublic static Set<String> fetchRelationNames(DatabaseMetaData meta, String catalog) throws SQLException
conn - SQLExceptionpublic static Map<String,Relation> fetchColumns(Connection conn) throws SQLException
SQLExceptionpublic static Map<String,Relation> fetchColumns(Connection conn, String schema, String table) throws SQLException
SQLExceptionpublic static Map<String,Relation> fetchColumns(DatabaseMetaData meta, String catalog) throws SQLException
SQLExceptionpublic static Map<String,Relation> fetchColumns(DatabaseMetaData meta, String catalog, String schema, Iterable<String> tables) throws SQLException
SQLExceptionpublic static Map<String,Relation> fetchColumns(DatabaseMetaData meta, String catalog, String schema, String table) throws SQLException
SQLExceptionpublic static com.google.common.collect.Multimap<String,Index> fetchIndexes(DatabaseMetaData meta, String catalog, String schemaName, Iterable<String> tableNames, boolean unique) throws SQLException
SQLExceptionpublic static com.google.common.collect.Multimap<String,Index> fetchIndexes(DatabaseMetaData meta, String catalog, String schemaName, String tableName, boolean unique) throws SQLException
SQLExceptionpublic static com.google.common.collect.Multimap<String,Index> fetchIndexesUnsafe(DatabaseMetaData meta, String catalog, String schemaName, String tableName, boolean unique) throws SQLException
SQLExceptionCopyright © 2015. All rights reserved.