My problem is that intellij raise an error that unable to resolve table user.
Table is created in database it can be seen in database in Intellij but it looks like compiler doesn't have an access to it. Did someone have similiar problem?
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());
}
CodePudding user response:
If you can confirm that the table exists and you connect to the right database, the error message might be misleading. This can be caused by incorrect database/dialect settings as well as other IntelliJ db connection settings.
CodePudding user response:
Press "choose schema" link :)
CodePudding user response:
Yes im connected to right db cause when i insert new data into table users it appears there , dialect is set to MariaDB global and for project. Problem appears when im trying query a table in method getUser, function doesnt work.