About the "Date".

When a user registers, a timestamp should be marked down together with other information.

then the property "RegisterTime" of UserBean should be of type "Date", the mapping type in hbm.xml should be "timestamp", and in MySQL, the column type should be "DateTime".

in java, we only need to set a "new Date()" to the property.

 

Ok, the world goes around smoothly.

你可能感兴趣的:(java,mysql,xml)