提问人:Elephants unite 提问时间:1/7/2023 最后编辑:Elephants unite 更新时间:1/7/2023 访问量:761
如何查找位置处的PostgreSQL语法错误(使用Eclipse)
how to find postgresql syntax error at position (using eclipse)
问:
我在eclipse中使用Postgres进行sql,我运行了我的代码,它给了我一个错误
syntax error at end of input position 13
但是,我对找到位置 13 有点困惑,因为我使用的是 eclipse,并且我已经编写了大约 200 行代码,但我认为它不是第 13 行。
我不知道我是不是傻了,但我不知道如何在上述位置找到错误,因为我不知道如何找到位置!
String query = "SELECT * FROM BRANCH";
ResultSet rs = executeQuery(connection, query);
try {
while (rs.next()) {
System.out.println("Column 1 returned");
System.out.println(rs.getString(1));
}
} catch (SQLException e) {
e.printStackTrace();
}
rs.close();
dropTable(connection, " delayedFlights");
createTable(connection," delayedFlights( ID_of_Delayed_Flight int pr"
+ "imary key, month int, dayOfMonth int, dayOfWeek int, depTime int, scheduledDeptTime int, arrTime int, "
+ "scheduledArrTime int, uniqueCarrier varchar(5), flightNum int, actualFlightTime int, scheduledFlightTime int,"
+ "airTime int, arrDelay int, depDelay int, orig varchar(5), dest varchar(5), distance int);");
int rows = insertIntoTableFromFile(connection, "delayedFlights", "src/delayedFlights.txt");
System.out.println(rows + " rows inserted.");
dropTable(connection, " airport");
createTable(connection, " airport( airportCode int primary key, airportName varchar(20), city varchar(25),"
+ "state varchar(25));");
int rows2 = insertIntoTableFromFile(connection, "airport", "src/airport.txt");
System.out.println(rows2 + " rows inserted.");
答: 暂无答案
下一个:无法识别缺少的右括号
评论