我正在尝试用 java 创建一个项目,但我在使用 MySQL 时遇到问题,在尝试获取表中的 Material 后,我收到此错误消息:
java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'table' at line 1
String sql = "SELECT Name, OS, Disk, Office, Serialnomain, Serialnotast, Serialnoscreen, Serialnomouse FROM table ";
ResultSet rs = stmt.executeQuery(sql);
最佳答案
将您的名称从表格更改为其他任何名称,就可以正常工作了。
关于java - 我在将数据从 MySQL 获取到我的 java 项目时遇到问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62197497/