datetime « Date « Java Database Q&A





1. How to convert java.util.date to java.sql.date?    stackoverflow.com

I am trying to use java.util.Date as input and then creating a query with it - so I need java.sql.Date. I was surprised to find that it couldn't do the ...

2. handling DATETIME values 0000-00-00 00:00:00 in JDBC    stackoverflow.com

I get an exception (see below) if I try to do

resultset.getString("add_date");
for a JDBC connection to a MySQL database containing a DATETIME value of 0000-00-00 00:00:00 (the quasi-null value for DATETIME), ...

3. java.util.Date vs java.sql.Date    stackoverflow.com

java.util.Date vs java.sql.Date: when to use which and why?

4. How to convert String to Java.sql.date and Java.sql.time    stackoverflow.com

If I have a method like this:

public static String convertDateTimeToString(DateTime dt) {
    return dt.getDate() + " " + dt.getTime();
}
Which takes a Datetime object of my own which contains ...

5. Date format for datatype as Date/Time    stackoverflow.com

As I have taken reg no as datatype number in ms access DB therefor we use Integer.parseInt for reg no. as i have taken name as text in ms access DB therefor we use ...

6. how do i create a custom date?    stackoverflow.com

need some help! this is sort of a 2 part question.. ive done a decent amount of programming but ive never really worked with dates, ive googled and all that but finding ...

7. How can I convert a Timestamp into either Date or DateTime object?    stackoverflow.com

I'm retrieving a timestamp object from a database using ResultSet.getTimestamp(), but I'd like an easy way to get the date in the format of MM/DD/YYYY and the time in a format ...

8. How to set current date and time using prepared statement?    stackoverflow.com

I have a column in database having datatype DATETIME. I want to set this column value to current date and time using `PreparedStatement. How do I do that?