【发布时间】:2018-11-05 02:37:57
【问题描述】:
我想做一个 CRUD,但我的变量 SortieA 有问题,它是 NULL 吗?看这里的图片 => enter image description here
这是我班级相册的问题?
public class Album {
private String codeA;
private String titreA;
private Date sortieA;
private Chanteur chanteurAlb;
public Album() {
}
public Album(String codeA, String titreA, Date sortieA, Chanteur chanteurAlb) {
this.codeA = codeA;
this.titreA = titreA;
this.sortieA = sortieA;
this.chanteurAlb = chanteurAlb;
}
public String getCodeA() {
return codeA;
}
public void setCodeA(String codeA) {
this.codeA = codeA;
}
public String getTitreA() {
return titreA;
}
public void setTitreA(String titreA) {
this.titreA = titreA;
}
public Date getSortieA() {
return sortieA;
}
public void setSortieA(Date sortieA) {
this.sortieA = sortieA;
}
public Chanteur getChanteurAlb() {
return chanteurAlb;
}
public void setChanteurAlb(Chanteur chanteurAlb) {
this.chanteurAlb = chanteurAlb;
}
这是我的要求
public boolean insertAlbum (Album alb)
{
boolean ok = ConnexionMySQL.getInstance().actionQuery("Insert into album (CodeA, TitreA, SortieA, IdentC) values ('" + alb.getCodeA() + "','" + alb.getTitreA() +
"'," + alb.getSortieA() + "," + alb.getChanteurAlb().getIdentC() + ")");
return ok;
}
请问你有什么想法吗?
【问题讨论】:
-
您如何判断您发布的代码是否足以让我们判断是什么导致问题?在我看来,我认为您没有,从我们的角度来看,minimal reproducible example 将有很大帮助。请考虑创建一个并将其与您的问题一起发布。
-
除了@HovercraftFullOfEels 建议的 MCVE 注意:not 发布(链接到)textual 信息的图像 - 发布文本本身(作为文本)。尤其是当该消息的关键不是英语时。 (谷歌还没有翻译图片中的文字!)