This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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.
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();