JAVA连接ORACLE,
java.sql.SQLException: ORA-00942: 表或视图不存在
TOMCAT控制台报错如下:
java.sql.
SQLException: ORA-00942: 表或视图不存在
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
:111)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:330)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:287)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:742)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.
java:212)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPrepare
dStatement.java:795)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStateme
nt.java:1030)
at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPrepa
redStatement.java:835)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStateme
nt.java:1123)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePrep
aredStatement.java:3284)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePrepare
dStatement.java:3328)
at qyxx.userDB.loginCheck(userDB.java:39)
at org.apache.jsp.user_005fdeal_jsp._jspService(user_005fdeal_jsp.java:7
我找到红色那句,然后,把相应的SQL语句放在isql*plus中执行,却能够正常出来结果,这是为什么呢?
SQL语句:String sql = "select DISTINCT priority,name,age,sex, depart_name, depart_id from system.QYXX_USER a, system.QYXX_DEPARTMENT b where a.username='"+username+"' and a.password = '"+password+"' and b.id = a.depart_id";
我把username和password放一个组数据库里有的数据,在isql*plus在正常
------解决方案--------------------会不会是映射的数据库名字错了?
------解决方案--------------------在程序里面把system.QYXX_USER的system.去掉
------解决方案--------------------看看owner是不是system,不是的话,替换。。
select owner, table_name from dba_tables where table_name ='QYXX_USER';
------解决方案--------------------我在想你的程序连oracle的实例是不是连错了啊哥们。