How to get time information in java.sql.Date?
The answser is, you cannot.
java.sql.Date does not store/retrieve any information related to time.
So, how do you solve the problem of saving the date with time in your database?
Simple... use java.sql.Timestamp. There are methods in java.sql.PreparedStatement and java.sql.Statement to set the timestamp.
For a detailed analysis and usage, point to the title of this post that takes you to "Semicolon" blog by Bennett McElwee.
[Resource-Type: Tip; Category: Java/JDBC; XRating: 3]








1 Comments:
What is the wright technique to write a session variable in JSP? As for example we have project which contains some collection in header.jsp. I think it is not wright technique but i am not sure. so i have need expert knowledge about session variable writing tech. in JSP.
7:35 AM
Post a Comment
<< Home