[英]java/SQL ORA-00942 table or view does not exist
I have been having a problem with the sql. 我一直在与SQL问题。 I have been trying to build a login system that will read a username and password from an oracle DB. 我一直在尝试构建一个登录系统,该系统将从oracle数据库读取用户名和密码。 When I connect and carry out the command 当我连接并执行命令时
String sql="select * from tutilizadores where username= ? and password= ?";
I get the error message ORA-00942. 我收到错误消息ORA-00942。 The table has been created under sys. 该表已在sys下创建。 I am confused. 我很困惑。
Here is the code that refers to the problem: 以下是涉及该问题的代码:
String sql="select * from tutilizadores where username= ? and password= ?";
PreparedStatement pst = conn.prepareStatement(sql);
pst.setString(1, USERNAME.getText());
pst.setString(2, PASSWORD.getText());
rs=(OracleResultSet)pst.executeQuery();
if (rs.next()){
JOptionPane.showMessageDialog(null, "O username e password estavam bem");
//Fecha a janela
//close();
//nova janela-Tutilizadores
Tutilizadores c = new Tutilizadores();
c.setVisible(true);
}
Thanks a lot. 非常感谢。
The number of issues is usually limited to those few options: 问题的数量通常限于以下几种选择:
schema.tutilizadores
. 您需要使用schema.tutilizadores
的模式名来限定表名。 If not sure, then consider schema as the username used to create the table. 如果不确定,则将架构视为用于创建表的用户名。 For verifying what the issue is, consider executing and providing the output of following SQL: 为了验证问题所在,请考虑执行并提供以下SQL的输出:
SELECT table_name, owner
FROM dba_tables
WHERE lower(table_name) = 'tutilizadores'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.