简体   繁体   中英

How to insert a Date in a column datetime (sqlserver)

如何在不带时间的情况下仅将日期值插入日期时间字段中的特定日期(java.sql.Date)?

You should find your answer over here . There are many ways. You can convert it to a String and then use substring(x,y) function also.

When you are inserting record in Database use java.sql.Date and use setDate method. It will not insert time component of the date.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM