I am currently using SELECT datetime FROM table1 WHERE condition=? as the query and getting the ResultSet object, and I am using rs.getDate() and it is creating a Date object with no Time as part of it. Is it possible to get both the Date and the Time from the database?
I am currently using SELECT datetime FROM table1 WHERE condition=? as the query and
Share
getTimestamp()should fetch you both the “date” and “time” part. Read the docs forjava.sql.Date(which is returned bygetDateandjava.sql.Timestampfor knowing the difference between them.