Java SQL Date Get getDate(ResultSet rs, int index)

Here you can find the source of getDate(ResultSet rs, int index)

Description

get Date

License

Open Source License

Declaration

public static Date getDate(ResultSet rs, int index) throws java.sql.SQLException 

Method Source Code


//package com.java2s;
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt

import java.sql.ResultSet;
import java.util.Date;

public class Main {
    public static Date getDate(ResultSet rs, int index) throws java.sql.SQLException {
        if (rs.getTimestamp(index) != null) {
            return new Date(rs.getTimestamp(index).getTime());
        }/*  w  w w .j  av  a 2s. c  om*/

        return null;
    }
}

Related

  1. getDate(ResultSet aResultSet, String aColumnName)
  2. getDate(ResultSet res, String name)
  3. getDate(ResultSet resultSet, String columnName)
  4. getDate(ResultSet rs, int colNum)
  5. getDate(ResultSet rs, int columnIndex)
  6. getDate(ResultSet rs, String colName)
  7. getDate(ResultSet rs, String column)
  8. getDate(ResultSet rs, String columnLabel)
  9. getDate(ResultSet rs, String columnName)