git init
parent
47a5fac051
commit
198ad28d49
|
@ -17,7 +17,7 @@ public class BillDao {
|
|||
String sql = "INSERT INTO t_bill VALUES (0,?,?)";
|
||||
try (Connection conn = DriverManager.getConnection(URL, USER, PASSWORD);
|
||||
PreparedStatement pstmt = conn.prepareStatement(sql)) {
|
||||
pstmt.setDate(1, bill.getBillDate());
|
||||
pstmt.setString(1, bill.getBillDate());
|
||||
pstmt.setDouble(2, bill.getBillMonery());
|
||||
pstmt.executeUpdate();
|
||||
} catch (SQLException e) {
|
||||
|
|
|
@ -5,7 +5,7 @@ import java.util.Date;
|
|||
|
||||
public class Bill {
|
||||
private Integer billId;
|
||||
private Date billDate;
|
||||
private String billDate;
|
||||
private double billMonery;
|
||||
|
||||
public Bill() {
|
||||
|
@ -19,11 +19,11 @@ public class Bill {
|
|||
this.billId = billId;
|
||||
}
|
||||
|
||||
public java.sql.Date getBillDate() {
|
||||
return (java.sql.Date) billDate;
|
||||
public String getBillDate() {
|
||||
return billDate;
|
||||
}
|
||||
|
||||
public void setBillDate(Date billDate) {
|
||||
public void setBillDate(String billDate) {
|
||||
this.billDate = billDate;
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ public class Bill {
|
|||
this.billMonery = billMonery;
|
||||
}
|
||||
|
||||
public Bill(Integer billId, Date billDate, double billMonery) {
|
||||
public Bill(Integer billId, String billDate, double billMonery) {
|
||||
this.billId = billId;
|
||||
this.billDate = billDate;
|
||||
this.billMonery = billMonery;
|
||||
|
|
Loading…
Reference in New Issue