Here you can find the source of getDate(ResultSet aResultSet, String aColumnName)
Date
.
Parameter | Description |
---|---|
aResultSet | a parameter |
aColumnName | a parameter |
Parameter | Description |
---|---|
SQLException | an exception |
public static Date getDate(ResultSet aResultSet, String aColumnName) throws SQLException
//package com.java2s; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Timestamp; import java.util.Date; public class Main { /**//from www .j a va 2s. com * Returns the specified column of the result set as a <code>Date</code>. * * @param aResultSet * @param aColumnName * @throws SQLException */ public static Date getDate(ResultSet aResultSet, String aColumnName) throws SQLException { Timestamp timestamp = aResultSet.getTimestamp(aColumnName); return ((timestamp == null) || aResultSet.wasNull()) ? null : new Date(timestamp.getTime()); } }