Java SQL LocalDate setDate(PreparedStatement s, int col, LocalDate ld)

Here you can find the source of setDate(PreparedStatement s, int col, LocalDate ld)

Description

set Date

License

Apache License

Declaration

public static void setDate(PreparedStatement s, int col, LocalDate ld) throws SQLException 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.sql.PreparedStatement;

import java.sql.SQLException;

import java.sql.Types;

import java.time.LocalDate;

public class Main {
    public static void setDate(PreparedStatement s, int col, LocalDate ld) throws SQLException {
        if (ld == null) {
            s.setNull(col, Types.DATE);
        } else {/*from w ww  . j a v a 2s.c o  m*/
            s.setDate(col, java.sql.Date.valueOf(ld));
        }
    }
}

Related

  1. getDay(Date date)
  2. getLastDate()
  3. getLocalDate()
  4. getLocalDateFromUtilDate(Date input)
  5. getSqlDate(java.util.Date paramDate)
  6. toDate(LocalDate localDate)
  7. toDate(LocalDate localDate)
  8. toDate(LocalDate localDate)
  9. toInstant(Date date)