Search code examples
mysqlsqlsysdateinsert-statement

Sysdate function in SQL Insert query


I am writing code in jsp. I am running following query, which runs well but place a NULL in entryDate-column in DB.

int j=st.executeUpdate("insert into mtc (entryDate) values sysdate()");

What is mistake in this query?

I have to store current system date in entryDate-column.


Solution

  • int j=st.executeUpdate("insert into mtc (entryDate) values (SYSDATE())");