Java Utililty Methods SQL Key

List of utility methods to do SQL Key

Description

The list of methods to do SQL Key are organized into topic(s).

Method

Object[]getData(String key)
Get data from a registered ResultSet.
return getData(key, true, -1);
ListgetForeignKeys(String toTable, Connection con, boolean force)
get Foreign Keys
toTable = normalizeTableName(toTable, con);
ResultSet rs = con.getMetaData().getExportedKeys(null, null, toTable);
List<String> sqls = new ArrayList<>(2);
while (rs.next()) {
    String tablename = rs.getString("FKTABLE_NAME");
    String fkname = rs.getString("FK_NAME");
    if (fkname != null) {
        sqls.add("alter table " + tablename + " drop constraint " + fkname);
...
booleanisKeyAnInteger(Connection dbConn)
is Key An Integer
Statement stmt = null;
ResultSet rs = null;
boolean isInt = false;
try {
    stmt = dbConn.createStatement();
    rs = stmt.executeQuery("SELECT Key FROM Indexer LIMIT 1");
    int type = rs.getMetaData().getColumnType(1);
    isInt = type == Types.BIGINT;
...