Here you can find the source of getTimestamp(ResultSet rs, String strColName)
Parameter | Description |
---|---|
rs | a parameter |
strColName | a parameter |
Parameter | Description |
---|---|
SQLException | an exception |
public static Timestamp getTimestamp(ResultSet rs, String strColName) throws SQLException
//package com.java2s; /**//from www . ja v a 2 s .c om SiBBr API - Interface p?blica de acesso aos registros de ocorr?ncia Copyright (C) 2015 SiBBr - Sistema de Informa??o sobre a Biodiversidade Brasileira This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Timestamp; public class Main { /** * Auxiliary method to avoid problems with null timestamp values * * @param rs * @param strColName * @return * @throws SQLException */ public static Timestamp getTimestamp(ResultSet rs, String strColName) throws SQLException { Timestamp value = rs.getTimestamp(strColName); return rs.wasNull() ? null : value; } }