我在运行这个 sql 语句时遇到问题。如果我在 mysql 中运行它,它工作正常,但在 java 中我得到这个错误:
You have an error in your SQL syntax; check the manual that corresponds
to your MySQL server version for the right syntax to use near '' at line 1
数据库有一个 id(pk) 自动生成,varchar,int,varchar;
有人能帮我吗?
int i = statement.executeUpdate("INSERT INTO sala values('','"+ nume.getText() + "', "+ Integer.parseInt(capacitate.getText())+ ", '" + sunet.getText()+"'");