Skip to main content

MS SQL Server 2000 for JDBC with NetBeans IDE 5.5 and Java EE 5

19 replies [Last post]
deepak1234
Offline
Joined: 2007-05-04

Hi all,

I have SQL Server 2000 database and using Microsoft SQL Server 2000 Driver for JDBC.

I have created my Persistence Unit using the above driver. In my database I have a Users table.

Now how do I go about creating the Entity Class for the Users table and link the primary key. And also Session Bean for Users entity class.

I have created the Users Entity Class in NetBeans IDE 5.5. Also I have used this entity to create Session Beans For Users entity class named UsersFacade and UsersFacadeLocal. Now I call the medthod from UsersFacade session Bean from ListUsers but I get the folowing error.

Local Exception Stack:
Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2006.8 (Build 060830)): oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Invalid object name 'USERS'.Error Code: 208
Call:SELECT MSISDN, PASSWORD, ADDRESS, FIRSTNAME, BROKERACC, AGE, LASTNAME, DEVICEID FROM USERS
Query:ReportQuery(commerc.Users)
at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:303)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:551)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:437)
at oracle.toplink.essentials.threetier.ServerSession.executeCall(ServerSession.java:465)
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.executeSelectCall(DatasourceCallQueryMechanism.java:270)
at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:600)
at oracle.toplink.essentials.internal.queryframework.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2115)
at oracle.toplink.essentials.internal.queryframework.ExpressionQueryMechanism.selectAllReportQueryRows(ExpressionQueryMechanism.java:2081)
at oracle.toplink.essentials.queryframework.ReportQuery.executeDatabaseQuery(ReportQuery.java:774)
at oracle.toplink.essentials.queryframework.DatabaseQuery.execute(DatabaseQuery.java:609)
at oracle.toplink.essentials.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:677)
at oracle.toplink.essentials.queryframework.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:731)
at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2218)
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.internal.ejb.cmp3.base.EJBQueryImpl.executeReadQuery(EJBQueryImpl.java:346)
at oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImpl.getResultList(EJBQueryImpl.java:447)
at commerc.UsersFacade.findAll(UsersFacade.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1050)
at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:165)
at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2766)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3847)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:184)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:118)
at $Proxy39.findAll(Unknown Source)
at mcommerce.ListUsers.processRequest(ListUsers.java:48)
at mcommerce.ListUsers.doGet(ListUsers.java:64)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:278)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:179)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Invalid object name 'USERS'.
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSExecuteRequest.processReplyToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.commonTransitionToState(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.postImplExecute(Unknown Source)
at com.microsoft.jdbc.base.BasePreparedStatement.postImplExecute(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.executeQueryInternal(Unknown Source)
at com.microsoft.jdbc.base.BasePreparedStatement.executeQuery(Unknown Source)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeSelect(DatabaseAccessor.java:711)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:486)
... 57 more
EJB5018: An exception was thrown during an ejb invocation on [UsersFacade]
javax.ejb.EJBException
at com.sun.ejb.containers.BaseContainer.processSystemException(BaseContainer.java:3730)
at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3630)
at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3431)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1247)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:192)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:118)
at $Proxy39.findAll(Unknown Source)
at mcommerce.ListUsers.processRequest(ListUsers.java:48)
at mcommerce.ListUsers.doGet(ListUsers.java:64)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:278)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:179)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
Caused by: Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2006.8 (Build 060830)): oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Invalid object name 'USERS'.Error Code: 208
Call:SELECT MSISDN, PASSWORD, ADDRESS, FIRSTNAME, BROKERACC, AGE, LASTNAME, DEVICEID FROM USERS
Query:ReportQuery(commerc.Users)
at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:303)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:551)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:437)
at oracle.toplink.essentials.threetier.ServerSession.executeCall(ServerSession.java:465)
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.executeSelectCall(DatasourceCallQueryMechanism.java:270)
at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:600)
at oracle.toplink.essentials.internal.queryframework.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2115)
at oracle.toplink.essentials.internal.queryframework.ExpressionQueryMechanism.selectAllReportQueryRows(ExpressionQueryMechanism.java:2081)
at oracle.toplink.essentials.queryframework.ReportQuery.executeDatabaseQuery(ReportQuery.java:774)
at oracle.toplink.essentials.queryframework.DatabaseQuery.execute(DatabaseQuery.java:609)
at oracle.toplink.essentials.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:677)
at oracle.toplink.essentials.queryframework.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:731)
at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2218)
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.internal.ejb.cmp3.base.EJBQueryImpl.executeReadQuery(EJBQueryImpl.java:346)
at oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImpl.getResultList(EJBQueryImpl.java:447)
at commerc.UsersFacade.findAll(UsersFacade.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1050)
at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:165)
at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2766)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3847)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:184)
... 30 more
Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Invalid object name 'USERS'.
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSExecuteRequest.processReplyToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.commonTransitionToState(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.postImplExecute(Unknown Source)
at com.microsoft.jdbc.base.BasePreparedStatement.postImplExecute(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.executeQueryInternal(Unknown Source)
at com.microsoft.jdbc.base.BasePreparedStatement.executeQuery(Unknown Source)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeSelect(DatabaseAccessor.java:711)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:486)
... 57 more
StandardWrapperValve[Users]: Servlet.service() for servlet ListUsers threw exception
javax.ejb.EJBException
at com.sun.ejb.containers.BaseContainer.processSystemException(BaseContainer.java:3730)
at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3630)
at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3431)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1247)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:192)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:118)
at $Proxy39.findAll(Unknown Source)
at mcommerce.ListUsers.processRequest(ListUsers.java:48)
at mcommerce.ListUsers.doGet(ListUsers.java:64)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:278)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:179)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
Caused by: Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2006.8 (Build 060830)): oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Invalid object name 'USERS'.Error Code: 208
Call:SELECT MSISDN, PASSWORD, ADDRESS, FIRSTNAME, BROKERACC, AGE, LASTNAME, DEVICEID FROM USERS
Query:ReportQuery(commerc.Users)
at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:303)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:551)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:437)
at oracle.toplink.essentials.threetier.ServerSession.executeCall(ServerSession.java:465)
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.executeSelectCall(DatasourceCallQueryMechanism.java:270)
at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:600)
at oracle.toplink.essentials.internal.queryframework.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2115)
at oracle.toplink.essentials.internal.queryframework.ExpressionQueryMechanism.selectAllReportQueryRows(ExpressionQueryMechanism.java:2081)
at oracle.toplink.essentials.queryframework.ReportQuery.executeDatabaseQuery(ReportQuery.java:774)
at oracle.toplink.essentials.queryframework.DatabaseQuery.execute(DatabaseQuery.java:609)
at oracle.toplink.essentials.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:677)
at oracle.toplink.essentials.queryframework.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:731)
at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2218)
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.internal.ejb.cmp3.base.EJBQueryImpl.executeReadQuery(EJBQueryImpl.java:346)
at oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImpl.getResultList(EJBQueryImpl.java:447)
at commerc.UsersFacade.findAll(UsersFacade.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1050)
at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:165)
at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2766)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3847)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:184)
... 30 more
Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Invalid object name 'USERS'.
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSExecuteRequest.processReplyToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.commonTransitionToState(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.postImplExecute(Unknown Source)
at com.microsoft.jdbc.base.BasePreparedStatement.postImplExecute(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.executeQueryInternal(Unknown Source)
at com.microsoft.jdbc.base.BasePreparedStatement.executeQuery(Unknown Source)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeSelect(DatabaseAccessor.java:711)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:486)
... 57 more

Please can anyone help me with this.

Thanx
Deepak

[/]

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
edson.richter@mgrinformatica.com.br

Sorry, I didn't ask you: what Persistence implementation are you using?
The tip I sent is about TopLink. For Hibernate, there is a option too, but I don't know
exactly what should you use.
Unfortunatelly, cache management is not standardized in JPA.

AFAIK, an option is disable cache direct on Persistence.xml...

Regards,

Edson Richter

> Hi all,
>
> In order to do this:
>
> [b]Query q = em.createQuery("select O from USERS O");
> q.setHint(TopLinkQueryHints.REFRESH, HintValues.TRUE);
> return q.getResultList();[/b]
>
>
> I need to import
>
> [b]import oracle.toplink.config.HintValues;
> import oracle.toplink.config.TopLinkQueryHints;[/b]
>
> But I m not able to import these setting...please help me with these.
>
> Thanx
> [Message sent by forum member 'deepak1234' (deepak1234)]
>
> http://forums.java.net/jive/thread.jspa?messageID=216237
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

deepak1234
Offline
Joined: 2007-05-04

Hi,

I am using Toplink not Hibernate...

I think I will have to set the classpath for this......

Thanx...

Edson Carlos Ericksson Richter

Hum, did you add the TopLink library to the project? If so, then you
already have this classes on your classpath.

Regards,

Edson Richter

glassfish@javadesktop.org escreveu:
> Hi,
>
> I am using Toplink not Hibernate...
>
> I think I will have to set the classpath for this......
>
> Thanx...
> [Message sent by forum member 'deepak1234' (deepak1234)]
>
> http://forums.java.net/jive/thread.jspa?messageID=216404
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>
>
>
>

[edson.richter.vcf]
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

deepak1234
Offline
Joined: 2007-05-04

Hi zambizzi,

I changed the user account to sa and its working now.

Thanx.

deepak1234
Offline
Joined: 2007-05-04

Hi,

I have used sa account and able to capture the database shema.

But when I run my project it gives the following error:

[b]ADM1041:Sent the event to instance:[ResourceDeployEvent -- reference-added jdbc/commerc]
CORE5004: Resource Deployed: [jdbc:commerc].
disconnect
logout_successful
CORE5022: All ejb(s) of [commerc] were unloaded successfully!
ADM1064:The upload file at [C:\WINDOWS\Temp\s1astempdomain1server-943396518\commerc.ear] exists and will be overwritten.
ADM1006:Uploading the file to:[C:\WINDOWS\Temp\s1astempdomain1server-943396518\commerc.ear]
Deleted previous deployment directory: F:\Sun\SDK\domains\domain1\applications\j2ee-apps\commerc_old
deployed with moduleid = commerc
[TopLink Config]: 2007.05.08 11:19:04.659--ServerSession(28722705)--The alias name for the entity class [class commerc.Users] is being defaulted to: Users.
[TopLink Config]: 2007.05.08 11:19:04.659--ServerSession(28722705)--The table name for entity [class commerc.Users] is being defaulted to: USERS.
[TopLink Config]: 2007.05.08 11:19:04.659--ServerSession(28722705)--The column name for element [private java.lang.String commerc.Users.MSISDN] is being defaulted to: MSISDN.
[TopLink Config]: 2007.05.08 11:19:04.659--ServerSession(28722705)--The column name for element [private java.lang.String commerc.Users.FirstName] is being defaulted to: FIRSTNAME.
[TopLink Config]: 2007.05.08 11:19:04.659--ServerSession(28722705)--The column name for element [private java.lang.String commerc.Users.LastName] is being defaulted to: LASTNAME.
[TopLink Config]: 2007.05.08 11:19:04.659--ServerSession(28722705)--The column name for element [private java.lang.String commerc.Users.Password] is being defaulted to: PASSWORD.
[TopLink Config]: 2007.05.08 11:19:04.659--ServerSession(28722705)--The column name for element [private java.lang.String commerc.Users.address] is being defaulted to: ADDRESS.
[TopLink Config]: 2007.05.08 11:19:04.659--ServerSession(28722705)--The column name for element [private int commerc.Users.BrokerAcc] is being defaulted to: BROKERACC.
[TopLink Config]: 2007.05.08 11:19:04.659--ServerSession(28722705)--The column name for element [private int commerc.Users.age] is being defaulted to: AGE.
[TopLink Config]: 2007.05.08 11:19:04.659--ServerSession(28722705)--The column name for element [private java.lang.String commerc.Users.DeviceID] is being defaulted to: DEVICEID.
naming.bind
LDR5010: All ejb(s) of [commerc] loaded successfully!
WEB0100: Loading web module [commerc:commerc-war.war] in virtual server [server] at [/commerc-war]
[TopLink Config]: 2007.05.08 11:19:14.954--ServerSession(28722705)--property toplink.server.platform.class.name is deprecated, property toplink.target-server should be used instead.
topLink_version
application_server_name_and_version
platform=>SQLServerPlatform
user name=> ""
connector=>JNDIConnector datasource name=>null
);|connecting
Dec 17 2002 14:22:05
Copyright (c) 1988-2003 Microsoft Corporation
Developer Edition on Windows NT 5.1 (Build 2600: Service Pack 1)
;SQLServer;2.2.0040;
;|connected_user_database_driver
platform=>SQLServerPlatform
user name=> ""
connector=>JNDIConnector datasource name=>null
);|connecting
Dec 17 2002 14:22:05
Copyright (c) 1988-2003 Microsoft Corporation
Developer Edition on Windows NT 5.1 (Build 2600: Service Pack 1)
;SQLServer;2.2.0040;
;|connected_user_database_driver
login_successful
Local Exception Stack:
Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2006.8 (Build 060830)): oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Invalid object name 'USERS'.Error Code: 208
Call:SELECT MSISDN, PASSWORD, ADDRESS, FIRSTNAME, BROKERACC, AGE, LASTNAME, DEVICEID FROM USERS
Query:ReportQuery(commerc.Users)
at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:303)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:551)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:437)
at oracle.toplink.essentials.threetier.ServerSession.executeCall(ServerSession.java:465)
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.executeSelectCall(DatasourceCallQueryMechanism.java:270)
at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:600)
at oracle.toplink.essentials.internal.queryframework.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2115)
at oracle.toplink.essentials.internal.queryframework.ExpressionQueryMechanism.selectAllReportQueryRows(ExpressionQueryMechanism.java:2081)
at oracle.toplink.essentials.queryframework.ReportQuery.executeDatabaseQuery(ReportQuery.java:774)
at oracle.toplink.essentials.queryframework.DatabaseQuery.execute(DatabaseQuery.java:609)
at oracle.toplink.essentials.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:677)
at oracle.toplink.essentials.queryframework.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:731)
at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2218)
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.internal.ejb.cmp3.base.EJBQueryImpl.executeReadQuery(EJBQueryImpl.java:346)
at oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImpl.getResultList(EJBQueryImpl.java:447)
at commerc.UsersFacade.findAll(UsersFacade.java:50)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1050)
at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:165)
at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2766)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3847)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:184)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:118)
at $Proxy38.findAll(Unknown Source)
at mcommerce.ListUsers.processRequest(ListUsers.java:48)
at mcommerce.ListUsers.doGet(ListUsers.java:64)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:278)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:179)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Invalid object name 'USERS'.
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSExecuteRequest.processReplyToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.commonTransitionToState(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.postImplExecute(Unknown Source)
at com.microsoft.jdbc.base.BasePreparedStatement.postImplExecute(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.executeQueryInternal(Unknown Source)
at com.microsoft.jdbc.base.BasePreparedStatement.executeQuery(Unknown Source)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeSelect(DatabaseAccessor.java:711)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:486)
... 57 more[/b]

Please help me with these...

Thanx....

mvatkina
Offline
Joined: 2005-04-04

Did you create your entities from tables in another database?

If you can't access the tables either from the application of while caturing the schema, something is wrong with your driver settings. We tested Java Persistence with MSSQL 2005 as it's the latest version.

Please also note that the generated code has a bug that has been fixed in the later NB builds:
public void destroy(Users users) {
em.merge(users);
em.remove(users);
}

should be
public void destroy(Users users) {
em.remove(em.merge(users));
}

Regards,
-marina

zambizzi
Offline
Joined: 2005-08-19

May I suggest that you include MSSQL 2000 in your official testing - I think it'd be a huge mistake to overlook the importance of that version of the database. The cost of upgrading from 2000 to 2005 (as well as the learning curve) is significant - leaving many, many installations of MSSQL 2000 in the wild for much longer than non-commercial databases. The situation is different in the open source world where things can be more freely and incrementally updated.

Speaking from experience...with all of our enterprise apps currently running on 2000, we won't even consider 2005 for several years. I know of several large companies locally (and not) in the same scenario.

Edson Carlos Ericksson Richter

Normally this error occur when you have wrong database selected.
Please, check you JDBC url.
I'll help you to solve this case, since I use MS SQL Server from 7 to
2005, and all works fine.

Steps to make connections stable:
1) Download latest SQL Server 2000 for JDBC SP3;
2) Configure your URL to something like:
jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=MY_DB;SelectMethod=Cursor;
3) Make sure you have three JARs in your classpath: mssqlserver.jar,
msbase.jar and msutil.jar

Additional: try to execute same query using a well know working SQL
tool, like SquirrelSQL.

Other source of this kind of error is when user has no access to the
database. Check on security (SQL Enterprise Manager) if user is
associated to the database. If you environment is for development or
staging, give roles "db_datareader" and "db_datawriter" to the user, so
it will be able to read/write all tables on this database.

Regards,

Edson Richter
Senior Java Developer
MCSE/SQL Server Certified Professional

glassfish@javadesktop.org escreveu:
> Hi all,
>
> I have SQL Server 2000 database and using Microsoft SQL Server 2000 Driver for JDBC.
>
> I have created my Persistence Unit using the above driver. In my database I have a Users table.
>
> Now how do I go about creating the Entity Class for the Users table and link the primary key. And also Session Bean for Users entity class.
>
> I have created the [b]Users[/b] Entity Class in NetBeans IDE 5.5. Also I have used this entity to create Session Beans For Users entity class named [b]UsersFacade[/b] and [b]UsersFacadeLocal[/b]. Now I call the medthod from UsersFacade session Bean from [b]ListUsers[/b] but I get the folowing error.
>
> Local Exception Stack:
> Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2006.8 (Build 060830)): oracle.toplink.essentials.exceptions.DatabaseException
> Internal Exception: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Invalid object name 'USERS'.Error Code: 208
> Call:SELECT MSISDN, PASSWORD, ADDRESS, FIRSTNAME, BROKERACC, AGE, LASTNAME, DEVICEID FROM USERS
> Query:ReportQuery(commerc.Users)
> at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:303)
> at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:551)
> at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:437)
> at oracle.toplink.essentials.threetier.ServerSession.executeCall(ServerSession.java:465)
> 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.executeSelectCall(DatasourceCallQueryMechanism.java:270)
> at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:600)
> at oracle.toplink.essentials.internal.queryframework.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2115)
> at oracle.toplink.essentials.internal.queryframework.ExpressionQueryMechanism.selectAllReportQueryRows(ExpressionQueryMechanism.java:2081)
> at oracle.toplink.essentials.queryframework.ReportQuery.executeDatabaseQuery(ReportQuery.java:774)
> at oracle.toplink.essentials.queryframework.DatabaseQuery.execute(DatabaseQuery.java:609)
> at oracle.toplink.essentials.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:677)
> at oracle.toplink.essentials.queryframework.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:731)
> at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2218)
> 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.internal.ejb.cmp3.base.EJBQueryImpl.executeReadQuery(EJBQueryImpl.java:346)
> at oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImpl.getResultList(EJBQueryImpl.java:447)
> at commerc.UsersFacade.findAll(UsersFacade.java:49)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1050)
> at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:165)
> at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2766)
> at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3847)
> at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:184)
> at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:118)
> at $Proxy39.findAll(Unknown Source)
> at mcommerce.ListUsers.processRequest(ListUsers.java:48)
> at mcommerce.ListUsers.doGet(ListUsers.java:64)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397)
> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:278)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
> at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:240)
> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:179)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
> at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
> at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
> at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239)
> at com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
> at com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
> at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
> at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
> at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
> at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
> at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
> Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Invalid object name 'USERS'.
> at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
> at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
> at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
> at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
> at com.microsoft.jdbc.sqlserver.tds.TDSExecuteRequest.processReplyToken(Unknown Source)
> at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
> at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknown Source)
> at com.microsoft.jdbc.base.BaseStatement.commonTransitionToState(Unknown Source)
> at com.microsoft.jdbc.base.BaseStatement.postImplExecute(Unknown Source)
> at com.microsoft.jdbc.base.BasePreparedStatement.postImplExecute(Unknown Source)
> at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
> at com.microsoft.jdbc.base.BaseStatement.executeQueryInternal(Unknown Source)
> at com.microsoft.jdbc.base.BasePreparedStatement.executeQuery(Unknown Source)
> at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeSelect(DatabaseAccessor.java:711)
> at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:486)
> ... 57 more
> EJB5018: An exception was thrown during an ejb invocation on [UsersFacade]
> javax.ejb.EJBException
> at com.sun.ejb.containers.BaseContainer.processSystemException(BaseContainer.java:3730)
> at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3630)
> at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3431)
> at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1247)
> at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:192)
> at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:118)
> at $Proxy39.findAll(Unknown Source)
> at mcommerce.ListUsers.processRequest(ListUsers.java:48)
> at mcommerce.ListUsers.doGet(ListUsers.java:64)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397)
> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:278)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
> at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:240)
> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:179)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
> at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
> at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
> at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239)
> at com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
> at com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
> at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
> at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
> at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
> at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
> at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
> Caused by: Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2006.8 (Build 060830)): oracle.toplink.essentials.exceptions.DatabaseException
> Internal Exception: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Invalid object name 'USERS'.Error Code: 208
> Call:SELECT MSISDN, PASSWORD, ADDRESS, FIRSTNAME, BROKERACC, AGE, LASTNAME, DEVICEID FROM USERS
> Query:ReportQuery(commerc.Users)
> at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:303)
> at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:551)
> at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:437)
> at oracle.toplink.essentials.threetier.ServerSession.executeCall(ServerSession.java:465)
> 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.executeSelectCall(DatasourceCallQueryMechanism.java:270)
> at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:600)
> at oracle.toplink.essentials.internal.queryframework.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2115)
> at oracle.toplink.essentials.internal.queryframework.ExpressionQueryMechanism.selectAllReportQueryRows(ExpressionQueryMechanism.java:2081)
> at oracle.toplink.essentials.queryframework.ReportQuery.executeDatabaseQuery(ReportQuery.java:774)
> at oracle.toplink.essentials.queryframework.DatabaseQuery.execute(DatabaseQuery.java:609)
> at oracle.toplink.essentials.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:677)
> at oracle.toplink.essentials.queryframework.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:731)
> at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2218)
> 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.internal.ejb.cmp3.base.EJBQueryImpl.executeReadQuery(EJBQueryImpl.java:346)
> at oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImpl.getResultList(EJBQueryImpl.java:447)
> at commerc.UsersFacade.findAll(UsersFacade.java:49)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1050)
> at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:165)
> at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2766)
> at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3847)
> at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:184)
> ... 30 more
> Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Invalid object name 'USERS'.
> at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
> at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
> at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
> at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
> at com.microsoft.jdbc.sqlserver.tds.TDSExecuteRequest.processReplyToken(Unknown Source)
> at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
> at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknown Source)
> at com.microsoft.jdbc.base.BaseStatement.commonTransitionToState(Unknown Source)
> at com.microsoft.jdbc.base.BaseStatement.postImplExecute(Unknown Source)
> at com.microsoft.jdbc.base.BasePreparedStatement.postImplExecute(Unknown Source)
> at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
> at com.microsoft.jdbc.base.BaseStatement.executeQueryInternal(Unknown Source)
> at com.microsoft.jdbc.base.BasePreparedStatement.executeQuery(Unknown Source)
> at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeSelect(DatabaseAccessor.java:711)
> at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:486)
> ... 57 more
> StandardWrapperValve[ListUsers]: Servlet.service() for servlet ListUsers threw exception
> javax.ejb.EJBException
> at com.sun.ejb.containers.BaseContainer.processSystemException(BaseContainer.java:3730)
> at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3630)
> at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3431)
> at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1247)
> at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:192)
> at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:118)
> at $Proxy39.findAll(Unknown Source)
> at mcommerce.ListUsers.processRequest(ListUsers.java:48)
> at mcommerce.ListUsers.doGet(ListUsers.java:64)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397)
> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:278)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
> at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:240)
> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:179)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
> at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
> at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
> at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239)
> at com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
> at com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
> at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
> at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
> at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
> at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
> at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
> Caused by: Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2006.8 (Build 060830)): oracle.toplink.essentials.exceptions.DatabaseException
> Internal Exception: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Invalid object name 'USERS'.Error Code: 208
> Call:SELECT MSISDN, PASSWORD, ADDRESS, FIRSTNAME, BROKERACC, AGE, LASTNAME, DEVICEID FROM USERS
> Query:ReportQuery(commerc.Users)
> at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:303)
> at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:551)
> at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:437)
> at oracle.toplink.essentials.threetier.ServerSession.executeCall(ServerSession.java:465)
> 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.executeSelectCall(DatasourceCallQueryMechanism.java:270)
> at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:600)
> at oracle.toplink.essentials.internal.queryframework.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2115)
> at oracle.toplink.essentials.internal.queryframework.ExpressionQueryMechanism.selectAllReportQueryRows(ExpressionQueryMechanism.java:2081)
> at oracle.toplink.essentials.queryframework.ReportQuery.executeDatabaseQuery(ReportQuery.java:774)
> at oracle.toplink.essentials.queryframework.DatabaseQuery.execute(DatabaseQuery.java:609)
> at oracle.toplink.essentials.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:677)
> at oracle.toplink.essentials.queryframework.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:731)
> at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2218)
> 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.internal.ejb.cmp3.base.EJBQueryImpl.executeReadQuery(EJBQueryImpl.java:346)
> at oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImpl.getResultList(EJBQueryImpl.java:447)
> at commerc.UsersFacade.findAll(UsersFacade.java:49)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1050)
> at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:165)
> at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2766)
> at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3847)
> at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:184)
> ... 30 more
> Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Invalid object name 'USERS'.
> at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
> at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
> at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
> at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
> at com.microsoft.jdbc.sqlserver.tds.TDSExecuteRequest.processReplyToken(Unknown Source)
> at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
> at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknown Source)
> at com.microsoft.jdbc.base.BaseStatement.commonTransitionToState(Unknown Source)
> at com.microsoft.jdbc.base.BaseStatement.postImplExecute(Unknown Source)
> at com.microsoft.jdbc.base.BasePreparedStatement.postImplExecute(Unknown Source)
> at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
> at com.microsoft.jdbc.base.BaseStatement.executeQueryInternal(Unknown Source)
> at com.microsoft.jdbc.base.BasePreparedStatement.executeQuery(Unknown Source)
> at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeSelect(DatabaseAccessor.java:711)
> at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:486)
> ... 57 more
>
>
>
>
> Please can anyone help me with this.
>
> Thanx
> Deepak
> [Message sent by forum member 'deepak1234' (deepak1234)]
>
> http://forums.java.net/jive/thread.jspa?messageID=215807
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>
>
>
>

[edson.richter.vcf]
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

deepak1234
Offline
Joined: 2007-05-04

The database url and database which my server is referencing is correct. I am able to ping to the database using this, also get the referenced table in the schema but when I run the server it gives the same error as before.

Please help me with this.

Thanx
Deepak

deepak1234
Offline
Joined: 2007-05-04

Hi,

I have solved the problem.

I am able to create users.....and also view.

But I am confused about one thing....whatever I have inserted in the Users table I am not able to view it. After inserting values from my program I opened SQL Server Enterprise Manager to see if the values are there. But I am not able to see the values there.

When I select the values from the program I can see the values. And what ever values I have inserted manually in the Users table, I cant view it when I select it in the program. Sounds very funny.

Can anyone please explain the mystery.

Edson Carlos Ericksson Richter

Hi!

Glad to know you get things working. Could you describe your complete
solution (what driver version, where did you put JAR files, step-by-step
server-side configuration, persistence.xml, and sample java code for
accessing the MS SQL Server), so somebody at Glassfish project could
document it on WIKI? This will avoid another user take so long to get
things working!

About the other problem you described, try to add following code just
before executing the query (this will avoid TopLink cache, to know if
this is the problem):

Query q = em.createQuery("select O from USERS O");
q.setHint(TopLinkQueryHints.REFRESH, HintValues.TRUE);
return q.getResultList();

(I did expect sintax is correct, since I just copy/paste then adapt from
my real code)

Regards,

Edson Richter

glassfish@javadesktop.org escreveu:
> Hi,
>
> I have solved the problem.
>
> I am able to create users.....and also view.
>
> But I am confused about one thing....whatever I have inserted in the Users table I am not able to view it. After inserting values from my program I opened SQL Server Enterprise Manager to see if the values are there. But I am not able to see the values there.
>
> When I select the values from the program I can see the values. And what ever values I have inserted manually in the Users table, I cant view it when I select it in the program. Sounds very funny.
>
> Can anyone please explain the mystery.
> [Message sent by forum member 'deepak1234' (deepak1234)]
>
> http://forums.java.net/jive/thread.jspa?messageID=216111
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>
>
>
>

[edson.richter.vcf]
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

deepak1234
Offline
Joined: 2007-05-04

Hi all,

In order to do this:

[b]Query q = em.createQuery("select O from USERS O");
q.setHint(TopLinkQueryHints.REFRESH, HintValues.TRUE);
return q.getResultList();[/b]

I need to import

[b]import oracle.toplink.config.HintValues;
import oracle.toplink.config.TopLinkQueryHints;[/b]

But I m not able to import these setting...please help me with these.

Thanx

deepak1234
Offline
Joined: 2007-05-04

please if anyone can help

zambizzi
Offline
Joined: 2005-08-19

I use MSSQL w/ Glassfish and can tell you - this error is coming directly from MSSQL and the problem lies at the very bottom of the chain. I would suggest trying a few things:

1. Try to change the database login to the "sa" account. If this works, the user you've chosen to login via JDBC does not have access to the USERS table.

2. Check the permissions on the USERS table and see if your JDBC login user account has (at least) read access on that table.

3. Try running the query produced by Toplink in Query Analyzer, it may offer more clues.

deepak1234
Offline
Joined: 2007-05-04

Hi all,

Seems like I have a problem with JDBC driver for SQL Server 2000.

I will have to install sqljdbc.dll which contains the procedures for this driver.

I am doing it now.....hope I am able to get through

Thanx
Deepak

Marc Ende

glassfish@javadesktop.org schrieb:
> Local Exception Stack:
> Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2006.8 (Build 060830)): oracle.toplink.essentials.exceptions.DatabaseException
> Internal Exception: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Invalid object name 'USERS'.Error Code: 208
> Call:SELECT MSISDN, PASSWORD, ADDRESS, FIRSTNAME, BROKERACC, AGE, LASTNAME, DEVICEID FROM USERS
>
It looks like mssql aren't happy with "USERS" as a table name. May be
you should choose another name for the table. (Maybe users is an
reserved word on mssql)

marc

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

deepak1234
Offline
Joined: 2007-05-04

Hi marc,

I have also tried this with other names but its giving the same error.

Please can you advise is the code below correct and is Java Persistence is compatible with SQL Server 2000 database:

My Users Entity Class:

[b]/*
* Users.java
*
* Created on May 6, 2007, 7:15 PM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/

package commerc;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Id;
import java.io.Serializable;
import java.*;
/**
* Entity class Users
*
* @author deepak
*/
@Entity
public class Users implements Serializable {

@Id
//@GeneratedValue(strategy = GenerationType.AUTO)
//private Long id;
private String MSISDN;
private String FirstName;
private String LastName;
private String Password;
private String address;
private int BrokerAcc;
private int age;
private String DeviceID;

/** Creates a new instance of Users */
// public Users() {
//}

/**
* Gets the id of this Users.
* @return the id
*/
// public Long getId() {
// return this.id;
//}

/**
* Sets the id of this Users to the specified value.
* @param id the new id
*/
// public void setId(Long id) {
// this.id = id;
// }

/**
* Returns a hash code value for the object. This implementation computes
* a hash code value based on the id fields in this object.
* @return a hash code value for this object.
*/
// @java.lang.Override
// public int hashCode() {
// int hash = 0;
// hash += (this.getId() != null ? this.getId().hashCode() : 0);
// return hash;
// }

/**
* Determines whether another object is equal to this Users. The result is
* true if and only if the argument is not null and is a Users object that
* has the same id field values as this object.
* @param object the reference object with which to compare
* @return true if this object is the same as the argument;
* false otherwise.
*/

/**
@java.lang.Override
public boolean equals(java.lang.Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Users)) {
return false;
}
Users other = (Users)object;
if (this.getId() != other.getId() && (this.getId() == null || !this.getId().equals(other.getId()))) return false;
return true;
}
*/

/**
* Returns a string representation of the object. This implementation constructs
* that representation based on the id fields.
* @return a string representation of the object.
*/
/**
@java.lang.Override
public java.lang.String toString() {
return "commerc.Users[id=" + getId() + "]";
}*/

@java.lang.Override
public java.lang.String toString() {
return "commerc.Users[id=" + getMSISDN() + "]";
}

public String getMSISDN() {
return MSISDN;
}

public void setMSISDN(String MSISDN) {
this.MSISDN = MSISDN;
}

public String getFirstName() {
return FirstName;
}

public void setFirstName(String FirstName) {
this.FirstName = FirstName;
}

public String getLastName() {
return LastName;
}

public void setLastName(String LastName) {
this.LastName = LastName;
}

public String getPassword() {
return Password;
}

public void setPassword(String Password) {
this.Password = Password;
}

public String getAddress() {
return address;
}

public void setAddress(String address) {
this.address = address;
}

public int getBrokerAcc() {
return BrokerAcc;
}

public void setBrokerAcc(int BrokerAcc) {
this.BrokerAcc = BrokerAcc;
}

public int getAge() {
return age;
}

public void setAge(int age) {
this.age = age;
}

public String getDeviceID() {
return DeviceID;
}

public void setDeviceID(String DeviceID) {
this.DeviceID = DeviceID;
}

}[/b]

This is my Session bean for above entity class

[b]/*
* UsersFacade.java
*
* Created on May 7, 2007, 10:01 PM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/

package commerc;

import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
*
* @author deepak
*/
@Stateless
public class UsersFacade implements UsersFacadeLocal {

@PersistenceContext
private EntityManager em;

/** Creates a new instance of UsersFacade */
public UsersFacade() {

}

public void create(Users users) {
em.persist(users);
}

public void edit(Users users) {
em.merge(users);
}

public void destroy(Users users) {
em.merge(users);
em.remove(users);
}

public Users find(Object pk) {
return (Users) em.find(Users.class, pk);
}

public List findAll() {
return em.createQuery("select object(o) from Users as o").getResultList();
}

public void persist(Object object) {
// TODO:
// em.persist(object);
}

}[/b]

Marc Ende

Hi,

I couldn't test the compatibility toplink - mssql, sorry I haven't got
any mssql server running.

glassfish@javadesktop.org schrieb:
> Hi marc,
>
> I have also tried this with other names but its giving the same error.
>
> Please can you advise is the code below correct and is Java Persistence is compatible with SQL Server 2000 database:
>
>
> /**
> *
> * @author deepak
> */
> @Stateless
> public class UsersFacade implements UsersFacadeLocal {
>
> [...]
>
> public List findAll() {
> return em.createQuery("select object(o) from Users as o").getResultList();
> }
>
> [...]

But I think the issue is in your findAll():

return em.createQuery("select e from Users e").getResultList()

yours

Marc

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

deepak1234
Offline
Joined: 2007-05-04

Hi

Can anyone help me with this please...

Thanx