我正在尝试从一个表中进行选择,该表适用于我的数据库中的所有其他表,但是当我尝试以下操作时,我收到一个错误:
db.makeQuery("SELECT * FROM References");
哪个电话:
public ResultSet makeQuery(String query) throws Exception
{
preparedStatement = connect.prepareStatement(query);
resultSet = preparedStatement.executeQuery(query);
return resultSet;
}
然后它会抛出以下错误:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:
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 'References' at line 1
我觉得我很奇怪,因为这个陈述有效:
db.makeQuery("select * from Products");