Here you can find the source of getColumnValue(ResultSet rs, ResultSetMetaData rsmd, int colIndex)
private static String getColumnValue(ResultSet rs, ResultSetMetaData rsmd, int colIndex) throws SQLException
//package com.java2s; //License from project: Open Source License import java.sql.*; public class Main { private static String getColumnValue(ResultSet rs, ResultSetMetaData rsmd, int colIndex) throws SQLException { String s = rs.getString(colIndex); if (rs.wasNull()) return "null"; switch (rsmd.getColumnType(colIndex)) { case Types.BIT: // bool or bit(n) if (s.equals("t") || s.equals("f")) return String.valueOf(rs.getBoolean(colIndex)); else//from ww w. j av a 2 s.c o m return s; case Types.DATE: // date return rs.getDate(colIndex).toString(); case Types.TIME: // time or timetz return rs.getTime(colIndex).toString(); case Types.TIMESTAMP: // timestamp or timestamptz return rs.getTimestamp(colIndex).toString(); default: return s; } } }