执行 "SHOW PROFILES" 时出错 "Column Index out of range, 0 < 1"
Error "Column Index out of range, 0 < 1" when executing "SHOW PROFILES"
如何在 jdbc 上执行查询 "SHOW PROFILES"?
我试过类似的方法:
try (ResultSet rs = stmt.executeQuery("SHOW PROFILES;");) {
while (rs.next()) {
System.out.println(rs.getString(0));
}
}
但是我遇到了异常 "Column Index out of range, 0 < 1. error "
。
错误是明确指出列索引应以 1 开头。
尝试将 rs.getString(0);
更改为 rs.getString(1);
查看此问题了解更多信息;
java.sql.SQLException: Column Index out of range, 0 < 1
如何在 jdbc 上执行查询 "SHOW PROFILES"?
我试过类似的方法:
try (ResultSet rs = stmt.executeQuery("SHOW PROFILES;");) {
while (rs.next()) {
System.out.println(rs.getString(0));
}
}
但是我遇到了异常 "Column Index out of range, 0 < 1. error "
。
错误是明确指出列索引应以 1 开头。
尝试将 rs.getString(0);
更改为 rs.getString(1);
查看此问题了解更多信息; java.sql.SQLException: Column Index out of range, 0 < 1