[Monetdb-developers] BUG in MonetDB V4.8.2 for windows

Fabian Groffen Fabian.Groffen at cwi.nl
Thu Oct 13 11:48:42 CEST 2005


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 <romulog at gmail.com>:
> 
>>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 at 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 at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/monetdb-developers




More information about the developers-list mailing list