在数据库中插入值字段为空

dhxwm5r4  于 2021-07-03  发布在  Java
关注(0)|答案(0)|浏览(292)

有人能给初学者一些建议吗?当我在businessname字段中输入数据时,它只插入null。
com.mysql.cj.jdbc.clientpreparedstatement:select*from username='utsavmalla'and password='malla'insert into feedbacks(用户名、姓名、业务名称、日期、电子邮件id、电话号码、订单id、注解、是否完成)value(?,?,?,?,?,?,?);com.mysql.cj.jdbc.clientpreparedstatement:插入到反馈(用户名、姓名、业务名称、日期、电子邮件id、电话号码、订单id、评论、完成时间)值(null,'opopopopopopo',null,'2020-12-07','opopopopop','opopopo','opopopopopo',opopopopopo',0);com.mysql.cj.jdbc.clientpreparedstatement:从反馈中选择*
反馈表jsp代码:

<fieldset class="form-group">
    <label>Business Name</label>
    <input type="text" value="<c:out value='${feedback.businessName}' />" class="form-control" name="business" required="required" minlength="5">
</fieldset>

我的反馈java类:

package net.java.lmfc.model;
import java.time.LocalDate;

/**
 * This is a model class represents a feedback entity
 */
public class Feedback {

    private Long id;
    private String username;
    private String name;
    private String businessName;
    private LocalDate date;
    private String emailId;
    private String phoneNumber;
    private String orderId;
    private String comment;
    private boolean status;

    protected Feedback() {}

    public Feedback(long id,String username, String name, String businessName , LocalDate date, String emailId, String phoneNumber, String orderId, String comment ,boolean isDone) {
        super();
        this.id = id;
        this.username = username;
        this.name = name;
        this.businessName = businessName;
        this.date = date;
        this.emailId = emailId;
        this.phoneNumber = phoneNumber;
        this.orderId = orderId;
        this.comment = comment;
        this.status = isDone;
    }

    public Feedback(String username, String name, String businessName , LocalDate date, String emailId, String phoneNumber, String orderId, String comment, boolean isDone) {
        super();
        this.username = username;
        this.name = name;
        this.businessName = businessName;
        this.date = date;
        this.emailId = emailId;
        this.phoneNumber = phoneNumber;
        this.orderId = orderId;
        this.comment = comment;
        this.status = isDone;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getBusinessName() {
        return businessName;
    }

    public void setBusinessName(String businessName){
        this.businessName = businessName;
    }

    public LocalDate getDate() {
        return date;
    }

    public void setdate(LocalDate date) {
        this.date = date;
    }

    public String getEmailId() {
        return emailId;
    }

    public void setEmailId(String emailId) {
        this.emailId = emailId;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public boolean getStatus() {
        return status;
    }

    public void setStatus(boolean status) {
        this.status = status;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + (int)(id ^ (id >>> 32));
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        Feedback other = (Feedback) obj;
        if (id != other.id)
            return false;
        return true;
    }
}

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题