public String performDropPreProcess(Statement stmt, String dropSql) throws SQLException {

        String alterStr = "alter";
        String tableStr = "table";
        String dropStr = "drop";
        String constraintStr = "constraint";

        java.util.StringTokenizer st = new java.util.StringTokenizer(dropSql);
        if (alterStr.equalsIgnoreCase(st.nextToken()) && tableStr.equalsIgnoreCase(st.nextToken())) {
            StringBuilder tableName = new StringBuilder(st.nextToken());

            if ((tableName.toString().startsWith("\"")) && (!tableName.toString().endsWith("\""))) {
                String next = null;
                while (true) {
                    next = st.nextToken();
                    tableName.append(" ").append(next);
                    if (next.endsWith("\\\"")) {
                        continue;
                    }
                    if (next.endsWith("\"")) {
                        break;
                    }
                }

            }
            if (dropStr.equalsIgnoreCase(st.nextToken())
                    && constraintStr.equalsIgnoreCase(st.nextToken())) {
                String constraintName = st.nextToken();

                // Table name might have whitespace characters within name so
                // just take whatever lies between
                // "alter table " and "drop constraint"

                int idxStart = dropSql.indexOf(tableStr, 0) + 5;
                int idxEnd = dropSql.lastIndexOf(dropStr);
                tableName = new StringBuilder(dropSql.substring(idxStart, idxEnd).trim());

                if (tableName.toString().startsWith("\"") && tableName.toString().endsWith("\"")) {
                    tableName = new StringBuilder(tableName.substring(1, tableName.length() - 1));
                }

                String arrStr = null;
                String queryStr = "sel IndexId, ChildTable, IndexName from dbc.RI_Distinct_ChildrenV where IndexName = '"
                        + constraintName + "'";
                java.sql.ResultSet rs = stmt.executeQuery(queryStr);

                if (rs.next()) {
                    arrStr = "drop table \"" + tableName + "_" + rs.getString(1) + "\"";
                    rs.close();
                    return arrStr;
                }
            }
        }
        return null;
    }
Get the name of the database type associated with the given
{@code java.sql.Types} typecode.

@param code
           {@link java.sql.Types} typecode
@param length
           the length or precision of the column
@param precision
           the precision of the column
@param scale
           the scale of the column

@return the database type name

@throws HibernateException
querydsl-jpa/src/test/java/com/querydsl/jpa/support/TeradataDialect.java