Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我尝试了很多东西,但无法在我的时间戳列中插入数据。从蟾蜍它可能使用这个
UPDATE SUPPORTSTAFF SET SUPPSTAFFJOINDATE=to_timestamp('27/02/2002 15:51.12.539880', 'dd/mm/yyyy hh24:mi.ss.ff') where JDBCUSERID='5700';
它的工作
但是我如何使用create statment从java类插入数据并执行查询它给我无效的月份错误
使用PreparedStatement带有参数的时间戳,例如
PreparedStatement
UPDATE SUPPORTSTAFF SET SUPPSTAFFJOINDATE = ? where JDBCUSERID = ?
然后设置参数:
statement.setTimestamp(1, new Timestamp(System.currentTimeMillis())); statement.setString(2, "your ID");
(显然,然后执行该语句。)