java.sql.SQLException:ORA-00917:缺失逗号String sql1 = "insert into KAOQINSIGN (EID,MORNINGS,MORNINGX,AFTERNOONS,AFTERNOONX,riqi)" +\x05\x05\x05\x05\x05"values('"+LoginFrame.i_user+"','"+Today.getNowTime()+"','"+ null +"'," +"','"+null+"','"+null+
来源:学生作业帮助网 编辑:作业帮 时间:2024/09/04 22:56:59
![java.sql.SQLException:ORA-00917:缺失逗号String sql1 =](/uploads/image/z/13383935-71-5.jpg?t=java.sql.SQLException%3AORA-00917%3A%E7%BC%BA%E5%A4%B1%E9%80%97%E5%8F%B7String+sql1+%3D+%22insert+into+KAOQINSIGN+%28EID%2CMORNINGS%2CMORNINGX%2CAFTERNOONS%2CAFTERNOONX%2Criqi%29%22+%2B%5Cx05%5Cx05%5Cx05%5Cx05%5Cx05%22values%28%27%22%2BLoginFrame.i_user%2B%22%27%2C%27%22%2BToday.getNowTime%28%29%2B%22%27%2C%27%22%2B+null+%2B%22%27%2C%22+%2B%22%27%2C%27%22%2Bnull%2B%22%27%2C%27%22%2Bnull%2B)
java.sql.SQLException:ORA-00917:缺失逗号String sql1 = "insert into KAOQINSIGN (EID,MORNINGS,MORNINGX,AFTERNOONS,AFTERNOONX,riqi)" +\x05\x05\x05\x05\x05"values('"+LoginFrame.i_user+"','"+Today.getNowTime()+"','"+ null +"'," +"','"+null+"','"+null+
java.sql.SQLException:ORA-00917:缺失逗号
String sql1 = "insert into KAOQINSIGN (EID,MORNINGS,MORNINGX,AFTERNOONS,AFTERNOONX,riqi)" +
\x05\x05\x05\x05\x05"values('"+LoginFrame.i_user+"',
'"+Today.getNowTime()+"',
'"+ null +"'," +"','"+null+"','"+null+"',
'"+Today.getNowDate()+"')";
LoginFrame.i_user是int类型,这句sql哪里错了?
java.sql.SQLException:ORA-00917:缺失逗号String sql1 = "insert into KAOQINSIGN (EID,MORNINGS,MORNINGX,AFTERNOONS,AFTERNOONX,riqi)" +\x05\x05\x05\x05\x05"values('"+LoginFrame.i_user+"','"+Today.getNowTime()+"','"+ null +"'," +"','"+null+"','"+null+
int类型如果在数据库中是number类型的话,插入的时候不要加单引号
去掉第一个值的单引号如下:
"values("+ LoginFrame.i_user+ ",'"
如果数据库中是字符型的话,就不是这个原因了
还有 在你的第一个null后面加了两个逗号,删掉一个试试