Java SQL ResultSet Read getLocalDate(ResultSet res, String name)

Here you can find the source of getLocalDate(ResultSet res, String name)

Description

get Local Date

License

Open Source License

Declaration

public static LocalDate getLocalDate(ResultSet res, String name) throws SQLException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.sql.ResultSet;

import java.sql.SQLException;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;

import java.util.Map;

public class Main {
    private static DateTimeFormatter tarmedFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd hh:mm:ss.S");

    public static LocalDate getLocalDate(ResultSet res, String name) throws SQLException {
        return LocalDate.parse(res.getString(name), tarmedFormatter);
    }//from  w w  w  . j  a v a 2s  .c  o m

    public static LocalDate getLocalDate(Map<String, String> map, String name) {
        return LocalDate.parse(map.get(name), tarmedFormatter);
    }
}

Related

  1. getIndex(ResultSet rs, int index)
  2. getList(ResultSet resultSet, String columnLabel, Class clazz)
  3. getList(ResultSet rs)
  4. getListFromRS(Class clazz, ResultSet rs)
  5. getListMapFromResultSet(ResultSet rs)
  6. getLocalDate(ResultSet rs, String columnName)
  7. getMap(ResultSet resultSet)
  8. getMap(ResultSet resultSet)
  9. getMap(ResultSet rs, ResultSetMetaData metaData, int cols_len)