我在 SQL 查询中使用的所有具有 public static final String NAME = "value" 的类现在都出现编译器错误“或预期的 DELIMITER,得到 'lastname'”。
您还可以找到下面的代码,以防它有助于复制它。
public class PeopleSQL
{
public static final String ID_COL = "id";
public static final String FIRSTNAME_COL = "firstname";
public static final String LASTNAME_COL = "lastname";
public static void getListOfPeople(Connection connection) throws RanaSQLException
{
PreparedStatement statement = null;
ResultSet result = null;
try
{
statement = connection.prepareStatement("SELECT " + ID_COL + ", " + LASTNAME_COL + " FROM people");
result = statement.executeQuery();
} catch (SQLException e) {
e.printStackTrace();
} finally {
try
{
result.close();
statement.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
}
class People
{
}
是的,我已经提交了错误报告。