Buggy code:
public class RelationalToCkanHelper { private static final Logger LOG = LoggerFactory . getLogger ( RelationalToCkanHelper . class ) ; public static List < ColumnDefinition > getColumnsForTable ( Connection conn , String tableName ) throws SQLException { } public static List < String > getTableIndexes ( Connection conn , String tableName ) throws SQLException { } public static List < String > getTablePrimaryKeys ( Connection conn , String tableName ) throws SQLException { } public static void tryCloseDbResources ( Connection conn , Statement stmnt , ResultSet rs ) { } public static void tryRollbackConnection ( Connection conn ) { } public static void tryCloseStatement ( Statement stmnt ) { } public static void tryCloseResultSet ( ResultSet rs ) { } public static void tryCloseConnection ( Connection conn ) { } public static void tryCloseHttpClient ( CloseableHttpClient client ) { } public static void tryCloseHttpResponse ( CloseableHttpResponse response ) { } public static JsonObject buildCreateDataStoreParameters ( String resourceId , List < String > indexes , List < String > primaryKeys , JsonArray fields , JsonArray records ) { } public static JsonObject buildDeleteDataStoreParamters ( String resourceId ) { } public static JsonArray buildFieldsDefinitionJson ( List < ColumnDefinition > columns ) { } public static JsonArray buildRecordsJson ( ResultSet rs , List < ColumnDefinition > columns ) throws SQLException { JsonBuilderFactory factory = Json . createBuilderFactory ( Collections . < String , Object > emptyMap ( ) ) ; JsonArrayBuilder recordsBuilder = factory . createArrayBuilder ( ) ; while ( rs . next ( ) ) { JsonObjectBuilder entryBuilder = factory . createObjectBuilder ( ) ; for ( ColumnDefinition column : columns ) { switch ( column . getColumnType ( ) ) { case Types . INTEGER : entryBuilder . add ( column . getColumnName ( ) , rs . getInt ( column . getColumnName ( ) ) ) ; break ; case Types . BIGINT : entryBuilder . add ( column . getColumnName ( ) , rs . getLong ( column . getColumnName ( ) ) ) ; break ; case Types . DECIMAL : case Types . NUMERIC : entryBuilder . add ( column . getColumnName ( ) , rs . getBigDecimal ( column . getColumnName ( ) ) ) ; break ; case Types . FLOAT : case Types . REAL : case Types . DOUBLE : entryBuilder . add ( column . getColumnName ( ) , rs . getDouble ( column . getColumnName ( ) ) ) ; break ; case Types . NVARCHAR : case Types . VARCHAR : case Types . LONGNVARCHAR : case Types . LONGVARCHAR : entryBuilder . add ( column . getColumnName ( ) , rs . getString ( column . getColumnName ( ) ) ) ; break ; case Types . BOOLEAN : case Types . BIT : entryBuilder . add ( column . getColumnName ( ) , rs . getBoolean ( column . getColumnName ( ) ) ) ; break ; case Types . TINYINT : case Types . SMALLINT : entryBuilder . add ( column . getColumnName ( ) , rs . getShort ( column . getColumnName ( ) ) ) ; break ; case Types . DATE : entryBuilder . add ( column . getColumnName ( ) , rs . getDate ( column . getColumnName ( ) ) . toString ( ) ) ; break ; case Types . TIMESTAMP : <START_BUG> entryBuilder . add ( column . getColumnName ( ) , rs . getTime ( column . getColumnName ( ) ) . toString ( ) ) ; <END_BUG> break ; case Types . ARRAY : entryBuilder . add ( column . getColumnName ( ) , RelationalToCkanHelper . getSqlArrayAsJsonArray ( factory , rs . getArray ( column . getColumnName ( ) ) ) ) ; break ; case Types . BLOB : case Types . CLOB : entryBuilder . addNull ( column . getColumnName ( ) ) ; break ; case Types . BINARY : case Types . VARBINARY : case Types . LONGVARBINARY : entryBuilder . addNull ( column . getColumnName ( ) ) ; break ; case Types . STRUCT : case Types . DISTINCT : case Types . REF : case Types . JAVA_OBJECT : default : entryBuilder . addNull ( column . getColumnName ( ) ) ; break ; } } recordsBuilder . add ( entryBuilder ) ; } return recordsBuilder . build ( ) ; } private static JsonArrayBuilder getSqlArrayAsJsonArray ( JsonBuilderFactory factory , Array array ) throws SQLException { } public static void main ( String [ ] args ) { } }

Fix:
entryBuilder . add ( column . getColumnName ( ) , rs . getTimestamp ( column . getColumnName ( ) ) . toString ( ) ) ;