List of utility methods to do SQL Date Format
String | formatDateTd(Object obj) format Date Td String out = "<td style='text-align:center'>"; String strDate = formatDate(obj); if (strDate.length() == 0) { out = (new StringBuilder()).append(out).append(" ").toString(); } else { out = (new StringBuilder()).append(out).append(strDate).toString(); out = (new StringBuilder()).append(out).append("</td>").toString(); ... |
Date | formatDateToCustfmt(java.util.Date date, String dateFmt) format Date To Custfmt if (date == null) { return null; java.text.SimpleDateFormat dateFormat = new java.text.SimpleDateFormat(dateFmt); return java.sql.Date.valueOf(dateFormat.format(date)); |
String | formatDurationMillisToString(long millis) format Duration Millis To String return formatMillisToString(millis, DURATION_PATTERN);
|
String | formatFloat(int floatValue) formatFloat Convert a float (java.sql.Float) representation into string. return (new Float(floatValue).toString()); |
String | formatLogParam(Array obj) Formatter for debugging purposes only. String result = ""; try { result = "(array of type" + obj.getBaseTypeName().length() + ")"; } catch (SQLException e) { result = "(array of unknown type)"; return result; |
String | formatNumberWithZeroPrefix(int numOfZero, Integer value) formatNumberWithZeroPrefix Convert a integer (java.sql.Integer) representation into string with Zeros prefix. return (formatNumberWithZeroPrefix(numOfZero, value, false));
|
String | formatSQLError(SQLException e) Formats the specified the SQL exception object displaying the error message, error code and the SQL state code. if (e == null) { return ""; StringBuilder sb = new StringBuilder(); sb.append(e.getMessage()); sb.append("\nError Code: " + e.getErrorCode()); String state = e.getSQLState(); if (state != null) { ... |
StringBuilder | formatSqlException(StringBuilder errorMessage, SQLException exception) format Sql Exception final String sqlState = exception.getSQLState(); final int errorCode = exception.getErrorCode(); final String message = exception.getMessage(); return errorMessage.append("SQLState: ").append(sqlState).append(" ErrorCode: ").append(errorCode) .append(" Message: ").append(message); |
String | formatSQLForColumnName(Connection conn, String strSQL) format SQL For Column Name String method = "formatSQLForColumnName"; int location = 1000; try { location = 2000; Statement stmt = conn.createStatement(); location = 2100; ResultSet rs = stmt.executeQuery(strSQL); location = 2200; ... |