List of utility methods to do SQL Key
Object[] | getData(String key) Get data from a registered ResultSet. return getData(key, true, -1);
|
List | getForeignKeys(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); ... |
boolean | isKeyAnInteger(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; ... |