小编ann*_*ina的帖子

java sql语法错误插入

我在运行此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
Run Code Online (Sandbox Code Playgroud)

数据库有一个id(pk)autogenerated,varchar,int,varchar;

有人能帮我吗?

int i = statement.executeUpdate("INSERT INTO sala values('','"+ nume.getText() + "', "+ Integer.parseInt(capacitate.getText())+ ", '" + sunet.getText()+"'");
Run Code Online (Sandbox Code Playgroud)

java sql insert

1
推荐指数
2
解决办法
1393
查看次数

标签 统计

insert ×1

java ×1

sql ×1