posted 20 years ago
Actually, depending on the database you're using, you might consider setting up your table so that it uses a timestamp field, or so your date field otherwise has the current date/time as the default value.
Then you don't have to worry about the current date/time in your Java code. You simply insert the new record, either passing a "null", or just not giving it any data for that field. The database engine will automatically use the current date/time when it adds the record.
Although, again, whether you can do this, and how you would do it, all depends on your back-end database.
- Jeff