0
尝试在表格中插入数据时,获取INVALID COLUMN INDEX。错误消息:java.sql.SQLException:列索引无效
这是我的DAO。不知道为什么有无效的列索引。
try{
currentCon = JavaConnectionDB.getConnection();
PreparedStatement ps=currentCon.prepareStatement("insert into lecturer (lecturerID,lecturerFullname,lecturerPassword) values'"
+ lecturerID + "','" + lecturerFullname + "','" + lecturerPassword +"'");
ps.setString(1,Lbean.getLecturerID());
ps.setString(2,Lbean.getLecturerFullname());
ps.setString(3,Lbean.getLecturerPassword());
ps.executeUpdate();
}
有什么我错过了?先谢谢你! :)
了解有关prepared statements.show您的表格定义 – Jens