If you don't want to think about how to represent a Date, simply let the driver to the job. PreparedStatement pstmt = con.prepareStatement("INSERT INTO statistic_url values(?, ?, ?)"); pstmt.setTimestamp(1, new Timestamp(System.getTimeinMillis()); pstmt.setInt(2, 2); pstmt.setInt(3, 1); pstmt.execute(); Or use a SimpleDateFormatter to generate the correct date format (YYYY-MM-dd HH:mm:sss.SSSSSS) before manually appending it to the query string. Andrei Martsinchyk wrote:
Hi Rómulo,
You did this in your Java program ? If so, try to use java.sql.Date, not java.util.Date:
Date dat = new java.sql.Date() ; Insert Into Statistic_URL values('dat',2,1);
2005/10/12, Romulo Gonçalves
: This email is to report a bug in MonetDB V4.8.2 for windows.
My name is Rómulo Gonçalves, number 0536601.
When I tried to insert one date value into one table with this code:
Data dat = new Date();
Insert Into Statistic_URL values(dat,2,1);
and I receive this error:
parse error, expecting `','' or `')'' in: "insert into statistic_url values(tue oct"
So I tried wiht this way:
Insert Into Statistic_URL values('dat',2,1);
I receive this error:
ERROR: INSERT INTO: NOT NULL constraint violated for column statistic_url.date_sta
I think this means that the data is not parseable, so it becomes null.
I hope you understand the bug. If you do not understand something just send an email to me.
Greets, Rómulo........
-- Best regards, Andrei Martsinchyk mailto:andrei.martsinchyk@gmail.com
------------------------------------------------------- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl _______________________________________________ Monetdb-developers mailing list Monetdb-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-developers