List of utility methods to do SQL Type
String | nativeSQL(String sql, boolean noBackslashEscapes) native SQL if (sql.indexOf('{') == -1) return sql; StringBuffer escapeSequenceBuf = new StringBuffer(); StringBuffer sqlBuffer = new StringBuffer(); char[] a = sql.toCharArray(); char lastChar = 0; boolean inQuote = false; char quoteChar = 0; ... |
Object | newArrayOfType(int typeCode, int size) Create a new array of the specified type and size. return newArrayOfType(typeCode, size, null);
|
T | newInstance(Class new Instance try { if (params == null || params.length == 0) { return clazz.newInstance(); } else { for (Constructor<?> ctor : clazz.getConstructors()) { if (ctor.getParameterTypes().length == params.length) { int paramIndex = 0; for (Class<?> paramType : ctor.getParameterTypes()) { ... |
List | parse(String txt, int level) parse ArrayList list = new ArrayList(); String quotesChars = getQuotesChars(level); String outerQuotes = getQuotesChars(level - 1); if (!txt.startsWith(outerQuotes + "(") && !txt.endsWith(outerQuotes + ")")) { throw new RuntimeException("Not a valid construct for a Row"); } else { txt = txt.substring(outerQuotes.length() + 1); txt = txt.substring(0, txt.length() - outerQuotes.length() - 1); ... |
String | prettyPrint(Object obj) Helper method StringBuilder sb = new StringBuilder(); if (obj == null) { sb.append("NULL"); } else if (obj instanceof Blob) { sb.append(formatLogParam((Blob) obj)); } else if (obj instanceof Clob) { sb.append(formatLogParam((Clob) obj)); } else if (obj instanceof Ref) { ... |
String | readAscii(Clob clob, String defaultValue) read Ascii if (clob == null) { return defaultValue; InputStream is = null; try { int length = (int) clob.length(); if (length == 0) { return defaultValue; ... |
List | readMapListBySQL(String fileDir, String sql, List read Map List By SQL List<Map<String, Object>> lists = new ArrayList<Map<String, Object>>(); StringBuilder headerLine = new StringBuilder(); StringBuilder headerLineTypes = new StringBuilder(); int headerSize = headers.size(); for (int i = 0; i < headerSize - 1; i++) { headerLine.append(headers.get(i)); headerLine.append(','); headerLineTypes.append(headerTypes.get(i)); ... |
Object | readObject(DataInput in, int sqlType) read Object switch (sqlType) { case Types.VARCHAR: return in.readUTF(); case Types.FLOAT: return Float.valueOf(in.readFloat()); case Types.DOUBLE: return Double.valueOf(in.readDouble()); case Types.BOOLEAN: ... |
String | resolveEscapes(String escaped, boolean noBackslashEscapes) resolve Escapes if (escaped.charAt(0) != '{' || escaped.charAt(escaped.length() - 1) != '}') throw new SQLException("unexpected escaped string"); int endIndex = escaped.length() - 1; if (escaped.startsWith("{fn ")) { String resolvedParams = replaceFunctionParameter(escaped.substring(4, endIndex)); return nativeSQL(resolvedParams, noBackslashEscapes); } else if (escaped.startsWith("{oj ")) { return nativeSQL(escaped.substring(4, endIndex), noBackslashEscapes); ... |
void | setFieldValue(Object oBean, String sFieldName, Object oValue) set Field Value if (oBean == null) { throw new RuntimeException("setFieldValue : bean instance is null "); if (sFieldName == null) { throw new RuntimeException("setFieldValue : field name is null "); String sFieldName2 = sFieldName.trim(); char cFirstChar = sFieldName2.charAt(0); ... |