这是我的代码,使用java作为前端,后端作为mysql,即使做了很多更改,异常也是一次又一次。
else if(s1.equals("Save")){
try
{
if(flag==1)
{
rs1.insertRow();
}
int id1=Integer.parseInt(tmid.getText());
String d=tdate.getText();
String ab=tabal.getText();
int amt=Integer.parseInt(tamt.getText());
String t1=ttt.getText()+":"+ttt2.getText();
String l=tlt.getText()+":"+tlt1.getText();
String o=tot.getText()+":"+tot1.getText();
rs1.updateString(2,d);
rs1.updateString(3,ab);
rs1.updateString(4,t1);
rs1.updateString(5,l);
rs1.updateString(6,o);
rs1.updateInt(7,amt);
rs1.updateInt(8,id1);
//System.out.println(rs3.getString(1));
System.out.println("JAYASHRI");
if(flag==1)
{
rs1.moveToInsertRow();
JOptionPane.showMessageDialog(this,"Adding New Record Successfully!!","Add New Record",JOptionPane.INFORMATION_MESSAGE);
}else if(s1.equals("Save")){
try
{
if(flag==1)
{
rs1.insertRow();
}
int id1=Integer.parseInt(tmid.getText());
String d=tdate.getText();
String ab=tabal.getText();
int amt=Integer.parseInt(tamt.getText());
String t1=ttt.getText()+":"+ttt2.getText();
String l=tlt.getText()+":"+tlt1.getText();
String o=tot.getText()+":"+tot1.getText();
rs1.updateString(2,d);
rs1.updateString(3,ab);
rs1.updateString(4,t1);
rs1.updateString(5,l);
rs1.updateString(6,o);
rs1.updateInt(7,amt);
rs1.updateInt(8,id1);
//System.out.println(rs3.getString(1));
System.out.println("JAYASHRI");
if(flag==1)
{
rs1.moveToInsertRow();
JOptionPane.showMessageDialog(this,"Adding New Record Successfully!!","Add New Record",JOptionPane.INFORMATION_MESSAGE);
}
示例图像错误,我无法删除数据库存储错误。
暂无答案!
目前还没有任何答案,快来回答吧!