- This topic has 1 reply, 2 voices, and was last updated 16 years, 11 months ago by Riyad Kalla.
-
AuthorPosts
-
skseoMemberHI,
See project example.. follow…
http://www.examplesondemand.com/
MyBlogJSFJPAExamplechange to fit oracle DB,
create table “BLOG”.”POST”(
“ID” INTEGER not null ,
“TITLE” VARCHAR(128) not null,
“CONTENT” CLOB,
“POSTTIME” TIMESTAMP,
primary key (“ID”)
);create unique index seq_gen_sequence on post(id);
/
insert into post values(1,’2341′,’satneouh’,’2007/01/01′)I want not derby DB, –>> oracle DB
so, i changed follow..oracle.jdbc.driver.OracleDriver
<persistence-unit name=”blog” transaction-type=”RESOURCE_LOCAL”>
<provider>
oracle.toplink.essentials.PersistenceProvider
</provider>
<class>com.myeclipseide.examples.myblog.persistence.Post</class>
<properties>
<property name=”toplink.jdbc.driver”
value=”oracle.jdbc.driver.OracleDriver” />
<property name=”toplink.jdbc.url”
value=”jdbc:oracle:thin:@localhost:1521:orcl” />
<property name=”toplink.jdbc.user” value=”blog” />
<property name=”toplink.jdbc.password” value=”blog” />
</properties>
</persistence-unit>[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
i come up with thi s error, can some one help in this regards. Its prompting Table or view does not exists, which table or view its looking for
[TopLink Warning]: 2008.02.22 06:43:44.656–ClientSession(18467372)–Exception [TOPLINK-4002] (Oracle TopLink Essentials – 2.0 (Build b40-rc (03/21/2007))): oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: ORA-00942: table or view does not existError Code: 942
Call: UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT + ? WHERE SEQ_NAME = ?
bind => [50, SEQ_GEN]
Query: DataModifyQuery()
2008. 2. 22 오후 6:43:44 com.myeclipseide.examples.myblog.persistence.EntityManagerHelper log
심�: save failed
Local Exception Stack:
Exception [TOPLINK-4002] (Oracle TopLink Essentials – 2.0 (Build b40-rc (03/21/2007))): oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: ORA-00942: table or view does not existError Code: 942
Call: UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT + ? WHERE SEQ_NAME = ?
bind => [50, SEQ_GEN]
Query: DataModifyQuery()
at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:296)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:639)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeNoSelect(DatabaseAccessor.java:688)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:477)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:437)
at oracle.toplink.essentials.internal.sessions.AbstractSession.executeCall(AbstractSession.java:675)
at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:213)
at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:199)
at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.executeNoSelectCall(DatasourceCallQueryMechanism.java:242)
at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.executeNoSelect(DatasourceCallQueryMechanism.java:222)
at oracle.toplink.essentials.queryframework.DataModifyQuery.executeDatabaseQuery(DataModifyQuery.java:71)
at oracle.toplink.essentials.queryframework.DatabaseQuery.execute(DatabaseQuery.java:609)
at oracle.toplink.essentials.internal.sessions.AbstractSession.internalExecuteQuery(AbstractSession.java:1815)
at oracle.toplink.essentials.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:937)
at oracle.toplink.essentials.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:909)
at oracle.toplink.essentials.sequencing.QuerySequence.update(QuerySequence.java:329)
at oracle.toplink.essentials.sequencing.QuerySequence.updateAndSelectSequence(QuerySequence.java:268)
at oracle.toplink.essentials.sequencing.StandardSequence.getGeneratedVector(StandardSequence.java:81)
at oracle.toplink.essentials.sequencing.DefaultSequence.getGeneratedVector(DefaultSequence.java:153)
at oracle.toplink.essentials.sequencing.Sequence.getGeneratedVector(Sequence.java:266)
at oracle.toplink.essentials.internal.sequencing.SequencingManager$Preallocation_Transaction_NoAccessor_State.getNextValue(SequencingManager.java:404)
at oracle.toplink.essentials.internal.sequencing.SequencingManager.getNextValue(SequencingManager.java:832)
at oracle.toplink.essentials.internal.sequencing.ClientSessionSequencing.getNextValue(ClientSessionSequencing.java:95)
at oracle.toplink.essentials.internal.descriptors.ObjectBuilder.assignSequenceNumber(ObjectBuilder.java:225)
at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.assignSequenceNumber(UnitOfWorkImpl.java:341)
at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.registerNotRegisteredNewObjectForPersist(UnitOfWorkImpl.java:3255)
at oracle.toplink.essentials.internal.ejb.cmp3.base.RepeatableWriteUnitOfWork.registerNotRegisteredNewObjectForPersist(RepeatableWriteUnitOfWork.java:323)
at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.registerNewObjectForPersist(UnitOfWorkImpl.java:3206)
at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerImpl.persist(EntityManagerImpl.java:190)
at com.myeclipseide.examples.myblog.persistence.PostDAO.save(PostDAO.java:27)
at com.myeclipseide.examples.myblog.jsf.PostController.saveCurrentPost(PostController.java:101)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.el.parser.AstValue.invoke(AstValue.java:131)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
at org.apache.jasper.el.JspMethodExpression.invoke(JspMethodExpression.java:68)
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
at javax.faces.component.UICommand.broadcast(UICommand.java:383)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLException: ORA-00942: table or view does not exist
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:955)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1168)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3368)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:632)
… 57 more
2008. 2. 22 오후 6:43:44 com.myeclipseide.examples.myblog.persistence.EntityManagerHelper log
ì •ë³´: finding all Post instanceshow to change code? derby DB -> oracle DB query and persistance.xml code?
Riyad KallaMemberI think you are doing the right steps, but you want to connect to your Oracle DB and make sure the Blog schema has been created with the Post table inside of it first.
Also to see what table it’s trying to access, look at the annotations in the Post class at the top. You also want to make sure Oracle is case sensative or not… if it is then your schema might need to be “Blog” and “Post”, not “BLOG” and “POST”.
-
AuthorPosts