Hi, I'm new to Java programming and I want to use date and time type for my database. I use MS Access as my database. Is there anyone have a complete program using date, time, or timestamp ? I can't understand if it's only a part of the program. Afterall, I'm really new. Thanks.
Joined: Jun 29, 2001
Hi Yudi, You may get some clues from the following code. Please note that in the code "JDBCMsAccessConnection" represents a class that establishes connection to the database. Good luck, Smitha ================================================================
String query = "INSERT INTO TESTING VALUES(?,?,?)"; pstmt=con.prepareStatement(query); pstmt.setInt(1,600); pstmt.setTimestamp(2, getTstamp()); // U can also use the following statement which inserts only time //pstmt.setDate(2, sqlDate); pstmt.setString(3,"CCCC"); pstmt.executeUpdate();