Hi, I am facing folowing problem while inserting data into mysql table mysql table is Create table MyDate(Date Date, MyDate DateTime)
These record I have added manuly. When I try to add record through Java it put 00 into all fields. Here is java code
===================== Now result is C:\Padmashree\working>java MyTime 2002-40-04 18:40:37 Thu Apr 04 18:40:37 CST 2002
What is happening here? Do i need to convert Java date type to mySql Date type ? is then how? Any help greately appreciated. - padma [ Edited by Dave to format code ] [ April 04, 2002: Message edited by: David O'Meara ]
Graham Thorpe
Ranch Hand
Joined: Mar 25, 2002
Posts: 264
posted
0
why don`t u insert directly current date in ur datatbase like "insert into mysql values(getdate())" then u get tge out putlike date format .. try this one if not understabdf mail me
Graham Thorpe
Ranch Hand
Joined: Mar 25, 2002
Posts: 264
posted
0
sorry just now i said to sqlserver... just put curdate()... inserrt into mysql values(curdate(),curdate())
padma patil
Ranch Hand
Joined: Nov 06, 2001
Posts: 41
posted
0
Hi, I have to insert date and time data into mysql database through java prpgram.curDate() method works for mqsql but not in java program. Realy appreciate if anyone solve this problem. - padma