Java SQL Date From toSqlDateFromStrDate(String p_strDate)

Here you can find the source of toSqlDateFromStrDate(String p_strDate)

Description

to Sql Date From Str Date

License

Apache License

Declaration

public static java.sql.Date toSqlDateFromStrDate(String p_strDate) throws ParseException 

Method Source Code


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

import java.text.ParseException;

public class Main {

    public static java.sql.Date toSqlDateFromStrDate(String p_strDate) throws ParseException {
        java.sql.Date returnDate = null;
        java.text.DateFormat sdf = new java.text.SimpleDateFormat();
        if (p_strDate != null && (!"".equals(p_strDate))) {
            returnDate = new java.sql.Date(sdf.parse(p_strDate).getTime());
        }/*from w ww.  ja  va2 s  .c o m*/
        return returnDate;
    }
}

Related

  1. toSqlDate(String date)
  2. toSqlDate(String date)
  3. toSqlDate(String dateStr, String format)
  4. toSQLDate(String dt)
  5. toSQLDate(String sDate, String format)
  6. toSqlDateJdbcEscape(final String str)
  7. toSqlDateString(java.sql.Date d, String pattern)