When writing a program, there are always some types of variables that are not very clear, now summarize the variables involved:
1, " time " type
(1), the variable type in the database is:DateTime such as:
DATETIME,//field type written in database
(2), the variable type in the Java program is:Date such as:
Private date operatetime;//operation time//set, get method public Date Getoperatetime () {return operatetim E } public void Setoperatetime (Date operatetime) {this.operatetime = Operatetime; }
(3), the type in the Sqlmap.xml configuration file:TimeStamp For example:
#operatetime: timestamp#,
2. Type of " money "
(1), the variable type in the database: money such as:
Refundamount money, //Refund Amount
(2), the variable type in the Java program:BigDecimal For example:
Private BigDecimal refundamount;//Refund amount //set, get method public BigDecimal Getrefundamount () { return refu Ndamount; } public void Setrefundamount (BigDecimal refundamount) { this.refundamount = Refundamount; }
(3), the variable type in the Sqlmap.xml configuration file:Decimal such as:
#refundamount:D ecimal#, //
Summary of the variable types of time and money in Java and database