PostgreSql 无法解析 table 用户
PostgreSql unable to resolve table user
我的问题是 intellij 引发了无法解析 table 用户的错误。
Table 是在数据库中创建的,它可以在 Intellij 的数据库中看到,但看起来编译器无法访问它。
有人遇到过类似问题吗?
enter image description here
public void getUser(String user) {
connect();
String SQL = "SELECT users , password FROM users WHERE users = ?";
try {
pstmt = connection.prepareStatement(SQL);
pstmt.setString(1, user);
pstmt.executeUpdate();
ResultSet rs = pstmt.executeQuery(SQL);
System.out.println(rs.getString("password"));
} catch (SQLException ex) {
System.out.println(ex.getMessage());
}
按“选择架构”link :)
如果您可以确认 table 存在并且您连接到正确的数据库,则错误消息可能具有误导性。这可能是由 incorrect database/dialect settings as well as other IntelliJ db connection settings.
引起的
我的问题是 intellij 引发了无法解析 table 用户的错误。
Table 是在数据库中创建的,它可以在 Intellij 的数据库中看到,但看起来编译器无法访问它。 有人遇到过类似问题吗?
enter image description here
public void getUser(String user) {
connect();
String SQL = "SELECT users , password FROM users WHERE users = ?";
try {
pstmt = connection.prepareStatement(SQL);
pstmt.setString(1, user);
pstmt.executeUpdate();
ResultSet rs = pstmt.executeQuery(SQL);
System.out.println(rs.getString("password"));
} catch (SQLException ex) {
System.out.println(ex.getMessage());
}
按“选择架构”link :)
如果您可以确认 table 存在并且您连接到正确的数据库,则错误消息可能具有误导性。这可能是由 incorrect database/dialect settings as well as other IntelliJ db connection settings.
引起的