Package org.aksw.commons.util.jdbc
Class JdbcUtils
java.lang.Object
org.aksw.commons.util.jdbc.JdbcUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfetchColumns(Connection conn) fetchColumns(Connection conn, String schema, String table) fetchColumns(DatabaseMetaData meta, String catalog) fetchColumns(DatabaseMetaData meta, String catalog, String schema, Iterable<String> tables) 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) fetchIndexes(DatabaseMetaData meta, String catalog, String schemaName, Iterable<String> tableNames, boolean unique) fetchIndexes(DatabaseMetaData meta, String catalog, String schemaName, String tableName, boolean unique) 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) fetchRelationNames(Connection conn) 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
-
Constructor Details
-
JdbcUtils
public JdbcUtils()
-
-
Method Details
-
fetchForeignKeys
public static com.google.common.collect.Multimap<String,ForeignKey> fetchForeignKeys(Connection conn) throws SQLException - Throws:
SQLException
-
fetchForeignKeys
public static com.google.common.collect.Multimap<String,ForeignKey> fetchForeignKeys(DatabaseMetaData meta, String catalog) throws SQLException - Throws:
SQLException
-
fetchForeignKeys
public static com.google.common.collect.Multimap<String,ForeignKey> fetchForeignKeys(DatabaseMetaData meta, String catalog, String schema, Iterable<String> tables) throws SQLException - Throws:
SQLException
-
fetchForeignKeys
public static com.google.common.collect.Multimap<String,ForeignKey> fetchForeignKeys(DatabaseMetaData meta, String catalog, String schema, String table) throws SQLException - Throws:
SQLException
-
fetchPrimaryKeys
- Throws:
SQLException
-
fetchPrimaryKeys
public static Map<String,PrimaryKey> fetchPrimaryKeys(DatabaseMetaData meta, String catalog) throws SQLException - Throws:
SQLException
-
fetchPrimaryKeys
public static Map<String,PrimaryKey> fetchPrimaryKeys(DatabaseMetaData meta, String catalog, String schema, Iterable<String> tables) throws SQLException - Throws:
SQLException
-
fetchPrimaryKeys
public static Map<String,PrimaryKey> fetchPrimaryKeys(DatabaseMetaData meta, String catalog, String schema, String table) throws SQLException - Throws:
SQLException
-
fetchRelationNames
- Throws:
SQLException
-
fetchRelationNames
public static Set<String> fetchRelationNames(DatabaseMetaData meta, String catalog) throws SQLException 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- Parameters:
conn-- Throws:
SQLException
-
fetchColumns
- Throws:
SQLException
-
fetchColumns
public static Map<String,Relation> fetchColumns(Connection conn, String schema, String table) throws SQLException - Throws:
SQLException
-
fetchColumns
public static Map<String,Relation> fetchColumns(DatabaseMetaData meta, String catalog) throws SQLException - Throws:
SQLException
-
fetchColumns
public static Map<String,Relation> fetchColumns(DatabaseMetaData meta, String catalog, String schema, Iterable<String> tables) throws SQLException - Throws:
SQLException
-
fetchColumns
public static Map<String,Relation> fetchColumns(DatabaseMetaData meta, String catalog, String schema, String table) throws SQLException - Throws:
SQLException
-
fetchIndexes
public static com.google.common.collect.Multimap<String,Index> fetchIndexes(DatabaseMetaData meta, String catalog, String schemaName, Iterable<String> tableNames, boolean unique) throws SQLException - Throws:
SQLException
-
fetchIndexes
public static com.google.common.collect.Multimap<String,Index> fetchIndexes(DatabaseMetaData meta, String catalog, String schemaName, String tableName, boolean unique) throws SQLException - Throws:
SQLException
-
fetchIndexesUnsafe
public static com.google.common.collect.Multimap<String,Index> fetchIndexesUnsafe(DatabaseMetaData meta, String catalog, String schemaName, String tableName, boolean unique) throws SQLException - Throws:
SQLException
-