使用Oracle数据库的Play框架-ORA-00942:表或视图不存在 [英] Play Framework using Oracle Database - ORA-00942: table or view does not exist

查看:261
本文介绍了使用Oracle数据库的Play框架-ORA-00942:表或视图不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法使用本地Oracle数据库解决问题. 我正在尝试连接到本地Oracle数据库(Oracle Database 11g Express Edition) 稍后,我将对另一个Oracle数据库使用JNDI,但我认为这仍然可以工作. 驱动程序:/lib

I can't solve my problem with my local Oracle database. I'm tryong to connect to my local Oracle database (Oracle Database 11g Express Edition) Later on I will use JNDI to another Oracle Database, but I think this should still work. Driver: ojdbc6.jar in /lib

db.default.driver=oracle.jdbc.driver.OracleDriver
db.default.url="jdbc:oracle:thin:@localhost:1521:xe"
db.default.user="user"
db.default.pass="pass"

所以我知道我确实连接到数据库,但是错误是它说该表不存在.我什至没有创建或查询表(不存在模型-但我也尝试过使用模型,同样的错误).一开始似乎有些错误,我不知道该如何调试.

So I know I do connect to the database, but the error is that it says that the table does not exist. I'm not even creating or querying to a table (no model exists - but I've tried with having a model too, same error). Something seems to be wrong in the beginning and I don't know how to Debug this.

错误:

**java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist**
 oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:457)
 oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:400)
 oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:926)
 oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:476)
 oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:200)
 oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:543)
 oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:197)
 oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:1213)
 oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1492)
 oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1710)
 oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:2006)
 oracle.jdbc.driver.OracleStatementWrapper.executeQuery(OracleStatementWrapper.java:1709)
 com.jolbox.bonecp.StatementHandle.executeQuery(StatementHandle.java:503)
 play.api.db.evolutions.Evolutions$.executeQuery(Evolutions.scala:118)
 play.api.db.evolutions.Evolutions$.databaseEvolutions(Evolutions.scala:334)
 play.api.db.evolutions.Evolutions$.evolutionScript(Evolutions.scala:306)
 play.api.db.evolutions.EvolutionsPlugin$$anonfun$onStart$1$$anonfun$apply$1.apply$mcV$sp(Evolutions.scala:435)
 play.api.db.evolutions.EvolutionsPlugin.withLock(Evolutions.scala:478)
 play.api.db.evolutions.EvolutionsPlugin$$anonfun$onStart$1.apply(Evolutions.scala:434)
 play.api.db.evolutions.EvolutionsPlugin$$anonfun$onStart$1.apply(Evolutions.scala:432)
 scala.collection.immutable.List.foreach(List.scala:309)
 play.api.db.evolutions.EvolutionsPlugin.onStart(Evolutions.scala:432)
 play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:63)
 play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:63)
 scala.collection.immutable.List.foreach(List.scala:309)
 play.api.Play$$anonfun$start$1.apply$mcV$sp(Play.scala:63)
 play.api.Play$$anonfun$start$1.apply(Play.scala:63)
 play.api.Play$$anonfun$start$1.apply(Play.scala:63)

在阅读它时,我仅发现我可能没有访问某些表的权限,但事实是,我在Oracle SQL Developer中使用了相同的登录名,并且可以正常工作.

When reading about it I've only found that I might not have permission to some table, but the thing is that I use the same login in Oracle SQL Developer and it works.

推荐答案

尝试手动创建包含以下列的play_evolutions表(通过将类型修改为Oracle使用的类型):

Try to manually create a play_evolutions table with the following columns (by adapting the types to the ones used by Oracle):

id int not null primary key, hash varchar(255) not null, 
applied_at timestamp not null, 
apply_script text, 
revert_script text, 
state varchar(255), 
last_problem text

这篇关于使用Oracle数据库的Play框架-ORA-00942:表或视图不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆