Problem using JDBC connection

I'am using 9iAS R2 and I have a entity bean using a DataSource with out any problem, but I also have a client program using the same datasource. I can lookup the datasource without any problems, I get a connection, but when I try to createStatement() on the connection I get an Exception see below.
I hope some one can help me!
Regards
Morten
java.lang.NullPointerException
     at com.evermind.sql.OrionPooledDataSource.addUsedConnection(OrionPooledDataSource.java:539)
     at com.evermind.sql.OrionPooledDataSource.getPooledInstance(OrionPooledDataSource.java:290)
     at com.evermind.sql.OrionCMTConnection.setConnection(OrionCMTConnection.java:189)
     at com.evermind.sql.OrionCMTConnection.intercept(OrionCMTConnection.java:127)
     at com.evermind.sql.FilterConnection.getMetaData(FilterConnection.java:75)
     at com.evermind.sql.FilterConnection.getMetaData(FilterConnection.java:76)
     at dk.modulus.regelmaskine.RegelParamDAO.getRegelParametre(RegelParamDAO.java:33)

Hi Morten,
Have you tried running OC4J in "debug" mode? This web page has more details:
http://kb.atlassian.com/content/atlassian/howto/orionproperties.jsp
You may also like to try "P6Spy"
http://www.theserverside.com/home/thread.jsp?thread_id=8337
And here is a web page from Oracle's "Technet" site regarding debugging
OC4J:
http://otn.oracle.com/tech/java/oc4j/htdocs/oc4j-logging-debugging-technote.html
Hope this helps you.
Good Luck,
Avi.

Similar Messages

  • How to use JDBC Connection Pools in a standalone application?

    Hi, there,
    I have a question about how to use JDBC Connection Pools in an application. I know well about connection pool itself, but I am not quite sure how to keep the pool management object alive all the time to avoid being destroyed by garbage collection.
    for example, at the website: http://www.developer.com/java/other/article.php/626291, there is a simple connection pool implementation. there are three classes:JDBCConnection, the application's gateway to the database; JDBCConnectionImpl, the real class/object to provide connection; and JDBCPool, the management class to manage connection pool composed by JDBCConnectionImpl. JDBCPool is designed by Singleton pattern to make sure only one instance. supposing there is only one client to use connection for many times, I guess it's ok because this client first needs instantiate JDBCPool and JDBCConnectionImpl and then will hold the reference to JDBCPool all the time. but how about many clients want to use this JDBCPool? supposing client1 finishes using JDBCPool and quits, then JDBCPool will be destroyed by garbage collection since there is no reference to it, also all the connections of JDBCConnectionImpl in this pool will be destroyed too. that means the next client needs recreate pool and connections! so my question is that if there is a way to keep pool management instance alive all the time to provide connection to any client at any time. I guess maybe I can set the pool management class as daemon thread to solve this problem, but I am not quite sure. besides, there is some other problems about daemon thread, for example, how to make sure there is only one daemon instance? how to quit it gracefully? because once the whole application quits, the daemon thread also quits by force. in that case, all the connections in the pool won't get chance to close.
    I know there is another solution by JNDI if we develop servlet application. Tomcat provides an easy way to setup JNDI database pooling source that is available to JSP and Servlet. but how about a standalone application? I mean there is no JNDI service provider. it seems a good solution to combine Commons DBCP with JNID or Apache's Naming (http://jakarta.apache.org/commons/dbcp/index.html). but still, I don't know how to keep pool management instance alive all the time. once we create a JNDI enviroment or naming, if it will save in the memory automatically all the time? or we must implement it as a daemon thread?
    any hint will be great apprieciated!
    Sam

    To my knoledge the pool management instance stays alive as long as the pool is alive. What you have to figure out is how to keep a reference to it if you need to later access it.

  • Trouble connecting to the Microsoft SQL Server 2005 using JDBC Connection

    Hi,
    I am unable to connect to the Microsoft SQL Server 2005 using JDBC Connection. Kindly tell me steps to connect to the SQL Server using JDBC. The error message that I am getting while creating a data source is :
    java.rmi.RemoteException: com.sap.engine.services.dbpool.exceptions.BaseRemoteException: Error during start of application "sap.com/JDBCConnector_KedDS.xml". [id = StartupError]
    at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.startApplication(DataSourceManagerImpl.java:608)
    at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.deploy(DataSourceManagerImpl.java:285)
    at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.createDataSource(DataSourceManagerImpl.java:342)
    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:324)
    at com.sap.pj.jmx.introspect.DefaultMBeanInvoker.invoke(DefaultMBeanInvoker.java:58)
    at com.sap.pj.jmx.mbeaninfo.AdditionalInfoProviderMBean.invoke(AdditionalInfoProviderMBean.java:289)
    at com.sap.pj.jmx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:944)
    at com.sap.pj.jmx.server.interceptor.MBeanServerWrapperInterceptor.invoke(MBeanServerWrapperInterceptor.java:288)
    at com.sap.engine.services.jmx.CompletionInterceptor.invoke(CompletionInterceptor.java:409)
    at com.sap.pj.jmx.server.interceptor.BasicMBeanServerInterceptor.invoke(BasicMBeanServerInterceptor.java:277)
    at com.sap.jmx.provider.ProviderInterceptor.invoke(ProviderInterceptor.java:258)
    at com.sap.engine.services.jmx.RedirectInterceptor.invoke(RedirectInterceptor.java:340)
    at com.sap.pj.jmx.server.interceptor.MBeanServerInterceptorChain.invoke(MBeanServerInterceptorChain.java:330)
    at com.sap.engine.services.jmx.MBeanServerSecurityWrapper.invoke(MBeanServerSecurityWrapper.java:287)
    at com.sap.engine.services.jmx.MBeanServerInvoker.invokeMbs(MBeanServerInvoker.java:131)
    at com.sap.engine.services.jmx.ClusterInterceptor.invokeMbs(ClusterInterceptor.java:212)
    at com.sap.engine.services.jmx.ClusterInterceptor.invoke(ClusterInterceptor.java:766)
    at com.sap.engine.services.jmx.MBeanServerInterceptorInvoker.invokeMbs(MBeanServerInterceptorInvoker.java:102)
    at com.sap.engine.services.jmx.connector.p4.P4ConnectorServerImpl.invokeMbs(P4ConnectorServerImpl.java:61)
    at com.sap.engine.services.jmx.connector.p4.P4ConnectorServerImplp4_Skel.dispatch(P4ConnectorServerImplp4_Skel.java:64)
    at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320)
    at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
    at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
    at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
    at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
    at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: java.rmi.RemoteException: Error occurred while starting application in whole cluster and wait.; nested exception is:
    com.sap.engine.services.deploy.exceptions.ServerDeploymentException: Clusterwide exception: server ID 13169050:com.sap.engine.services.dbpool.exceptions.BaseDeploymentException: Cannot create DataSource "KedDS".
    at com.sap.engine.services.dbpool.deploy.ContainerImpl.startDataSources(ContainerImpl.java:1843)
    at com.sap.engine.services.dbpool.deploy.ContainerImpl.prepareStart(ContainerImpl.java:489)
    at com.sap.engine.services.deploy.server.application.StartTransaction.prepareCommon(StartTransaction.java:223)
    at com.sap.engine.services.deploy.server.application.StartTransaction.prepare(StartTransaction.java:171)
    at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:301)
    at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesImpl(ParallelAdapter.java:342)
    at com.sap.engine.services.deploy.server.application.ParallelAdapter.runInTheSameThread(ParallelAdapter.java:126)
    at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesAndWait(ParallelAdapter.java:245)
    at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:4761)
    at com.sap.engine.services.deploy.server.DeployCommunicatorImpl.startApplicationAndWait(DeployCommunicatorImpl.java:661)
    at com.sap.engine.services.deploy.server.DeployCommunicatorImpl.startApplicationAndWait(DeployCommunicatorImpl.java:645)
    at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.startApplication(DataSourceManagerImpl.java:606)
    at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.deploy(DataSourceManagerImpl.java:285)
    at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.createDataSource(DataSourceManagerImpl.java:342)
    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:324)
    at com.sap.pj.jmx.introspect.DefaultMBeanInvoker.invoke(DefaultMBeanInvoker.java:58)
    at com.sap.pj.jmx.mbeaninfo.AdditionalInfoProviderMBean.invoke(AdditionalInfoProviderMBean.java:289)
    at com.sap.pj.jmx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:944)
    at com.sap.pj.jmx.server.interceptor.MBeanServerWrapperInterceptor.invoke(MBeanServerWrapperInterceptor.java:288)
    at com.sap.engine.services.jmx.CompletionInterceptor.invoke(CompletionInterceptor.java:409)
    at com.sap.pj.jmx.server.interceptor.BasicMBeanServerInterceptor.invoke(BasicMBeanServerInterceptor.java:277)
    at com.sap.jmx.provider.ProviderInterceptor.invoke(ProviderInterceptor.java:258)
    at com.sap.engine.services.jmx.RedirectInterceptor.invoke(RedirectInterceptor.java:340)
    at com.sap.pj.jmx.server.interceptor.MBeanServerInterceptorChain.invoke(MBeanServerInterceptorChain.java:330)
    at com.sap.engine.services.jmx.MBeanServerSecurityWrapper.invoke(MBeanServerSecurityWrapper.java:287)
    at com.sap.engine.services.jmx.MBeanServerInvoker.invokeMbs(MBeanServerInvoker.java:131)
    at com.sap.engine.services.jmx.ClusterInterceptor.invokeMbs(ClusterInterceptor.java:212)
    at com.sap.engine.services.jmx.ClusterInterceptor.invoke(ClusterInterceptor.java:766)
    at com.sap.engine.services.jmx.MBeanServerInterceptorInvoker.invokeMbs(MBeanServerInterceptorInvoker.java:102)
    at com.sap.engine.services.jmx.connector.p4.P4ConnectorServerImpl.invokeMbs(P4ConnectorServerImpl.java:61)
    at com.sap.engine.services.jmx.connector.p4.P4ConnectorServerImplp4_Skel.dispatch(P4ConnectorServerImplp4_Skel.java:64)
    at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320)
    at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
    at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
    at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
    at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
    at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: com.sap.engine.services.dbpool.exceptions.BaseInstantiationException: Cannot create instance ManagedConnectionFactoryImpl.
    at com.sap.engine.services.dbpool.spi.ManagedConnectionFactoryImpl.<init>(ManagedConnectionFactoryImpl.java:78)
    at com.sap.engine.services.dbpool.deploy.ContainerImpl.startDataSources(ContainerImpl.java:1779)
    ... 42 more
    Caused by: java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver
    Found in negative cache
    ------------------------- Loader Info -------------------------
    ClassLoader name: [library:KedDriver]
    Parent loader name: [Frame ClassLoader]
    No references !
    Resources:
    E:\usr\sap\J2E\JC01\j2ee\cluster\server0\bin\ext\KedDriver\sqljdbc.jar
    E:\usr\sap\J2E\JC01\j2ee\cluster\server0\bin\core_lib\opensqlport.jar
    Loading model: {parent,local,references}
    at com.sap.engine.frame.core.load.ReferencedLoader.loadClass(ReferencedLoader.java:360)
    at com.sap.engine.services.dbpool.spi.ManagedConnectionFactoryImpl.<init>(ManagedConnectionFactoryImpl.java:74)
    ... 43 more
    at com.sap.engine.services.deploy.server.DeployCommunicatorImpl.startApplicationAndWait(DeployCommunicatorImpl.java:663)
    at com.sap.engine.services.deploy.server.DeployCommunicatorImpl.startApplicationAndWait(DeployCommunicatorImpl.java:645)
    at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.startApplication(DataSourceManagerImpl.java:606)
    ... 31 more
    Caused by: com.sap.engine.services.deploy.exceptions.ServerDeploymentException: Clusterwide exception: server ID 13169050:com.sap.engine.services.dbpool.exceptions.BaseDeploymentException: Cannot create DataSource "KedDS".
    at com.sap.engine.services.dbpool.deploy.ContainerImpl.startDataSources(ContainerImpl.java:1843)
    at com.sap.engine.services.dbpool.deploy.ContainerImpl.prepareStart(ContainerImpl.java:489)
    at com.sap.engine.services.deploy.server.application.StartTransaction.prepareCommon(StartTransaction.java:223)
    at com.sap.engine.services.deploy.server.application.StartTransaction.prepare(StartTransaction.java:171)
    at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:301)
    at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesImpl(ParallelAdapter.java:342)
    at com.sap.engine.services.deploy.server.application.ParallelAdapter.runInTheSameThread(ParallelAdapter.java:126)
    at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesAndWait(ParallelAdapter.java:245)
    at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:4761)
    at com.sap.engine.services.deploy.server.DeployCommunicatorImpl.startApplicationAndWait(DeployCommunicatorImpl.java:661)
    at com.sap.engine.services.deploy.server.DeployCommunicatorImpl.startApplicationAndWait(DeployCommunicatorImpl.java:645)
    at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.startApplication(DataSourceManagerImpl.java:606)
    at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.deploy(DataSourceManagerImpl.java:285)
    at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.createDataSource(DataSourceManagerImpl.java:342)
    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:324)
    at com.sap.pj.jmx.introspect.DefaultMBeanInvoker.invoke(DefaultMBeanInvoker.java:58)
    at com.sap.pj.jmx.mbeaninfo.AdditionalInfoProviderMBean.invoke(AdditionalInfoProviderMBean.java:289)
    at com.sap.pj.jmx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:944)
    at com.sap.pj.jmx.server.interceptor.MBeanServerWrapperInterceptor.invoke(MBeanServerWrapperInterceptor.java:288)
    at com.sap.engine.services.jmx.CompletionInterceptor.invoke(CompletionInterceptor.java:409)
    at com.sap.pj.jmx.server.interceptor.BasicMBeanServerInterceptor.invoke(BasicMBeanServerInterceptor.java:277)
    at com.sap.jmx.provider.ProviderInterceptor.invoke(ProviderInterceptor.java:258)
    at com.sap.engine.services.jmx.RedirectInterceptor.invoke(RedirectInterceptor.java:340)
    at com.sap.pj.jmx.server.interceptor.MBeanServerInterceptorChain.invoke(MBeanServerInterceptorChain.java:330)
    at com.sap.engine.services.jmx.MBeanServerSecurityWrapper.invoke(MBeanServerSecurityWrapper.java:287)
    at com.sap.engine.services.jmx.MBeanServerInvoker.invokeMbs(MBeanServerInvoker.java:131)
    at com.sap.engine.services.jmx.ClusterInterceptor.invokeMbs(ClusterInterceptor.java:212)
    at com.sap.engine.services.jmx.ClusterInterceptor.invoke(ClusterInterceptor.java:766)
    at com.sap.engine.services.jmx.MBeanServerInterceptorInvoker.invokeMbs(MBeanServerInterceptorInvoker.java:102)
    at com.sap.engine.services.jmx.connector.p4.P4ConnectorServerImpl.invokeMbs(P4ConnectorServerImpl.java:61)
    at com.sap.engine.services.jmx.connector.p4.P4ConnectorServerImplp4_Skel.dispatch(P4ConnectorServerImplp4_Skel.java:64)
    at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320)
    at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
    at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
    at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
    at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
    at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: com.sap.engine.services.dbpool.exceptions.BaseInstantiationException: Cannot create instance ManagedConnectionFactoryImpl.
    at com.sap.engine.services.dbpool.spi.ManagedConnectionFactoryImpl.<init>(ManagedConnectionFactoryImpl.java:78)
    at com.sap.engine.services.dbpool.deploy.ContainerImpl.startDataSources(ContainerImpl.java:1779)
    ... 42 more
    Caused by: java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver
    Found in negative cache
    ------------------------- Loader Info -------------------------
    ClassLoader name: [library:KedDriver]
    Parent loader name: [Frame ClassLoader]
    No references !
    Resources:
    E:\usr\sap\J2E\JC01\j2ee\cluster\server0\bin\ext\KedDriver\sqljdbc.jar
    E:\usr\sap\J2E\JC01\j2ee\cluster\server0\bin\core_lib\opensqlport.jar
    Loading model: {parent,local,references}
    at com.sap.engine.frame.core.load.ReferencedLoader.loadClass(ReferencedLoader.java:360)
    at com.sap.engine.services.dbpool.spi.ManagedConnectionFactoryImpl.<init>(ManagedConnectionFactoryImpl.java:74)
    ... 43 more
    at com.sap.engine.services.deploy.server.application.ParallelAdapter.sleepClientThread(ParallelAdapter.java:270)
    at com.sap.engine.services.deploy.server.application.ParallelAdapter.runInTheSameThread(ParallelAdapter.java:127)
    at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesAndWait(ParallelAdapter.java:245)
    at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:4761)
    at com.sap.engine.services.deploy.server.DeployCommunicatorImpl.startApplicationAndWait(DeployCommunicatorImpl.java:661)
    ... 33 more
    at com.sap.engine.services.dbpool.exceptions.BaseRemoteException.writeReplace(BaseRemoteException.java:178)
    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:324)
    at java.io.ObjectStreamClass.invokeWriteReplace(ObjectStreamClass.java:896)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1011)
    at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
    at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:367)
    at javax.management.MBeanException.writeObject(MBeanException.java:126)
    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:324)
    at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:809)
    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1296)
    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
    at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
    at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:367)
    at com.sap.exception.BaseExceptionInfo.writeObject(BaseExceptionInfo.java:964)
    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:324)
    at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:809)
    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1296)
    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
    at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
    at com.sap.engine.services.jmx.ResponseMessage.writeBody(ResponseMessage.java:177)
    at com.sap.engine.services.jmx.Message.writeMsg(Message.java:257)
    at com.sap.engine.services.jmx.Message.getMsg(Message.java:453)
    at com.sap.engine.services.jmx.Message.writeExternal(Message.java:505)
    at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1267)
    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1245)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
    at com.sap.engine.services.jmx.connector.p4.P4ConnectorServerImplp4_Skel.dispatch(P4ConnectorServerImplp4_Skel.java:66)
    at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320)
    at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
    at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
    at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
    at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
    at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)

    i'm using jcreator pro
    jdk i.6
    mssql server 2005
    and downloaded the jdbc driver( i noticed that the msutil.jar and msbase.jar are not in the folder avalable on microsoft site Microsoft SQL Server 2005 JDBC Driver so i installed
    Microsoft SQL Server 2000 Driver for JDBC 1st and just changed the jqljdb.jar file with the one available in Microsoft SQL Server 2005 JDBC Driver )
    and set the path of the CLASSPATH to a folder which name has no spaces
    and tried Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
    and Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    and tried compiling and running with command prompt
    and still have the same exception which occurs at runtime
    "An exception has occured: java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver"
    i really need help

  • Oracle Package using JDBC Connection

    Post Author: pramodib
    CA Forum: Data Connectivity and SQL
    Hi
    I am using crystal report XI. I want to use JDBC connection and Oracle 10G database package.But when i connect to the database and choose that package it shows that the package not exists...Is it not possible to connect to the package????Can anyone plz give a comment
    Pramod P

    Post Author: yangster
    CA Forum: Data Connectivity and SQL
    no the only thing you can connect directly to in crystal are tables/views/stored proceduresto access the package you can write it into a store procedure so it can be executed that way

  • BLOB / CLOB operations using JDBC connections taken from WebLogic 6.0 connectrion pool

    Hi..
    I need to do some CLOB operations using JDBC connection taken
    from WebLogic 6.0 connection pool. Will weblogic 6.0 supports it.?
    I am getting errors when trying to do it in normal way .
    It seems like ResultSet.getClob() returns an RMI (kind of ) object
    instead of the Clob object.
    If you have any idea . Pls respond to [email protected]
    Nazilin

    Hi..
    I need to do some CLOB operations using JDBC connection taken
    from WebLogic 6.0 connection pool. Will weblogic 6.0 supports it.?
    I am getting errors when trying to do it in normal way .
    It seems like ResultSet.getClob() returns an RMI (kind of ) object
    instead of the Clob object.
    If you have any idea . Pls respond to [email protected]
    Nazilin

  • Problem using JDBC to connect to WBEM ODBC driver

    Hello,
    I've got a problem to connect to WBEM ODBC driver using JDBC. The error is:
    exception due a la requetejava.sql.SQLException: [Microsoft][WBEM ODBC Driver]Unable to connect
    When I try to connect to a MS access database, replacing only the ODBC source name, it's working. I can access to the MS access db. But when I put the WMI ODBC source name, WMI, I've got this error.
    Does anybody know what could happened? Is it possible to access to WMI through JDBC? With MS access, accessing WMI ODBC is working !
    Thanks very much for your help.
    Here is the part of the source code :
    import java.sql.*;
    import java.io.*;
    public class Main_1 {
    /** Creates a new instance of Main_1 */
    public Main_1() {
    * @param args the command line arguments
    public static void main(String[] args) {
    try {
    String url = "jdbc:odbc:WMI";
    Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection(url);     
    String query = "Select * from Win32_Processor";
    //String query = "Select * from test;";
    ResultSet results;
    Statement stmt = con.createStatement();
    results = stmt.executeQuery(query);
    //System.out.println (results);
    catch(Exception e){
         System.out.println("exception due a la requete" + e);
    e.printStackTrace();
    }

    you have to first start the network listener before you can run the program
    start TNSLSNR before running the jdbc program

  • HELP:Problem in creating a temporary CLOB using JDBC connection pooling

    Hi All,
    i am inserting a large xml document in an xml type column by creating a temporary clob of this document
    tempClob = CLOB.createTemporary(conn, true, CLOB.DURATION_SESSION);
    I am not having any success getting the following statement working using a JDBC connection pool rather than a hard coded URL connection
    it works with:
    "jdbc:oracle:thin:@server:port:dbname" connection
    Does NOT work with:
    datasource.getConnection()
    Does any one know how to successfully get this to work?
    urgently plz........

    Hi Dharmi
    Here is a quote of Dafna's post in [another thread in this forum|Re: Copy VC controls]
    CE7.1.1 will be released at September 2008 for ramp-up customers.
    There are many improvements and new capabilities in the new release of Visual Composer for CE7.1.1. Among the new features you can find:
    The missing features from Visual Composer 7.0 (Html view, portal Eventing support (EPCM), JDBC, Undo/Redo, and more..)
    Many layout & modeling improvements
    Additional ALV table functionality - export to Excel, switch to chart, configure ALV behavior at design time
    Integration of Visual Composer in Eclipse - additional entry point to the Visual Composer models from the NWDS. This integration provides the option to add a WD component (in case of missing functionality in Visual Composer), as a black box component to the Visual Composer model. Right-clicking the component will open the Web Dynpro perspective for creating/modifying the component.
    Regards,
       Shai

  • Any reported problems using jdbc over a WAN?

    If im trying to connect to a Database that's on a WAN will I experience any issues in using jdbc to connect and execute queries to that database?
    I know problems would come up if my wan network is slow, but has jdbc been able to handle long distance database queries? timeout values?

    but why?
    is it because of security? If a company had a database with your personal info hanging out on the Web for anyone to query without any validation or security, how would you feel about it?
    design pattern issues? It's just good layered design.
    just doesnt make sense?Not in my opinion.
    have u experienced/heard of any problems of
    connecting to a database over a WAN and executing
    queries?You don't say anything about who the client is. If the database is behind a firewall, outside clients shouldn't be able to access the port where the listener is running. Only port 80 should be open on that firewall.
    So you either write a servlet that listens on port 80 for HTTP requests from a browser-based client OR you ask your firewall admin to punch a hole in the firewall and open up the port on which your database is listening for queries and use a Swing client.
    If s/he agrees to do it, quit immediately. It means your company doesn't know anything about security.
    %

  • Problems Using JDBC

    Hi,
    I am trying to connect to a database using JDBC. But I get the invalid logon error. The surprising thing is that I can use the exact same username ("sys as sysdba") and the same password to login using SQLPlus. Anybody have any ideas why this might be happening?
    Cheers
    Suchit

    A couple points
    1) Your JDBC application should almost certainly not be trying to connect to an Oracle database using the SYS account (unless you're building a replacement for OEM). The SYS account is the most powerful account in the database and should not be used except for a handful of administrative actions. SYS is special-- there are a number of rules that don't apply to it that are likely to cause you frustration over time because things like the recycle bin work differently for SYS than for other users.
    2) Your application should never create tables in the SYS schema. That is a no-no, it's unsupported, and generally no good will come of it.
    So it is probably a good thing that your application started having problems connecting as SYS-- that should just reinforce the habit of creating new users, assigning those users appropriate privileges, and installing your application tables in that new schema. There are any number of things that you might have changed that would cause problems-- you're probably better off not trying to debug this problem. If you're still curious, can you post the exact Oracle error you are getting and the exact JDBC connection string you are using?
    Justin

  • ADVANCED QUEUE: USING JDBC CONNECTION -

    Advanced Queue using the JDBC connection gives us AN ERROR WHEN SENDING 32K QUEUES
    Is it true that RAW datatypes using the Java AQ API do indeed have a limit of 32K in 8.1.6.
    The workaround is to use the Java AQ API with Object payloads (BLOBs) to get around the problem.
    Has anyone used any other solution ?
    Thanks
    null

    There's a JDBC forum that's probably more germane to this question-- I'd suggest reposting it there.
    Justin Cave
    ODBC Development

  • Problem using JDBC Thin driver with Oracle 8i Personal Edition

    Hi all, I have an issue I have been unable to figure out. In order to make my code as portable as possible I am using the JDBC thin driver to access my database. I have been able to connect to an instance of Oracle 8i on a Sun box by hardcoding the following string into getConnection() call:
    conn = DriverManager.getConnection("jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(COMMUNITY=tcp.world)(PROTOCOL=TCP)(Host=<myhostname>)(Port=1521))(ADDRESS=(COMMUNITY=tcp.w orld)(PROTOCOL=TCP)(Host = <myhostname>)(Port = 1526)))(CONNECT_DATA = (SID = <mysidname>)))", <myuser>, <mypassword>);
    My problem is that I cannot figure out what string to use to connect to my local instance of Oracle 8i Personal. I used the following string (the sid I got from the looking at the init.ora file):
    conn = DriverManager.getConnection("jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(COMMUNITY=tcp.world)(PROTOCOL=TCP)(Host=localhost)(Port=1521))(ADDRESS=(COMMUNITY=tcp.world)(PRO TOCOL=TCP)(Host = localhost)(Port = 1526)))(CONNECT_DATA = (SID = orcl)))", "scott", "tiger");
    That didn't work, so I took the only entry found in my tnsnames.ora file in as:
    conn = DriverManager.getConnection("jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0)))(CONNECT_DATA = (SID = PLSExtProc)(PRESENTATION = RO)))", "scott", "tiger");
    I am not knowing what is wrong, but that didn't work neither. Any suggestions would be highly appreciated.
    Thanks....
    null

    try this:
    conn = DriverManager.getConnection("jdbc:oracle:thin:scott/tiger:@hostname:1521:sid");
    or use system/manager as username/passward
    null

  • AQ: Using JDBC connection

    Advanced Queue using the JDBC connection gives us AN ERROR WHEN SENDING 32K QUEUES
    Is it true that RAW datatypes using the Java AQ API do indeed have a limit of 32K in 8.1.6.
    The workaround is to use the Java AQ API with Object payloads (BLOBs) to get around the problem.
    Has anyone used any other solution for RAW data types ?
    Thanks
    null

    Don't conflate the issue here.
    This question is specific to SQL Command Tables.
    SQL Command Tables are given the name 'Command' in Crystal, regardless of what you use in the SQL alias.
    This is a very different and separate  situation from using Tables, where you can set the Crystal alias to the SQL alias.
    You don't have such equivalence when using SQL Command Tables.
    So you won't be able to reference Crystal aliases in SQL aliases in that situation, nor will you be able to access the SQL alias in the Command Table, without parsing the SQL query itelf.
    Sincerely,
    Ted Ueda

  • Can not deploy a report using JDBC connection on CR2008 Server

    Hi Group,
    I have a report created with JDBC connection. When I tried to add it to CR2008 server, it gives an error - "An unexpected error has occurred ". Basically I want to add a report to a public folder via CMC. I am using adminstrator account.
    Then I thought I need to add JDBC driver into CR2008 server. so I put oracle jdbc jar into CR2008 server classpath and add JDBC connection info into CRConfig.xml. but I still got the same error.
    I also tried:
    - Change the report to use native Oracle driver rather than JDBC. The deployment succeeded (but this is not what I want)
    - Add a data source connection via Business View Manager, but no luck.
    I know how to use/change jdbc connection with programtic way, but I just want to know if I want to use built-in components in CR2008 server without any coding the reports can be deployed and managed.
    Thanks in advance.
    Dennis

    Hello Will,
    Crystal Reports supports connections to JDBC/JNDI out of the box, and have done so for a while, whether stand-alone or published to Enterprise.
    To specify where the server would search for the JDBC driver jar files, you'd change the classpath tag found in the CRConfig.xml file found on the machine where the Crystal Reports Page or Job Server is running. 
    For early Crystal Enterprise 10 and before, it used Java Native Interface (JNI) to start the Java process to retrieve the data from the JDBC connection.
    For later Crystal Enterprise 10 and later, it starts off a "Java Server" process, and communicates to the Crystal Reports process via CORBA TCP/IP connection.
    Commonissues that may arise:  (1) CRConfig.xml not configured properly, (2) unable to start or communicate to the "Java Server" because of permissions or firewall.
    Note that this is a separate connectivity map from using ADO or ADO.NET.
    Sincerely,
    Ted Ueda

  • Problem using Jdbc-Odbc Bridge

    Hi,
    I am using Java 2 SDK and I am trying to access MS Access database on my machine using Jdbc-Odbc bridge. I have set up the DSN in ODBC. But I get the following error when I run my program -
    'No Suitable Driver'
    Here's my code snippet-
    Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
    String dsn = "jdbc:odbc:DriverInfoDB";
    Connection con = DriverManager.getConnection(dsn,"","");
    con.setAutoCommit(false);
    Statement stmt;
    String query = null; // SQL select string
    ResultSet rs; // SQL query results
    stmt = con.createStatement();
    .....etc etc...
    Where is the error in this code??
    Help Needed!!
    Thanks
    Vivek.

    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection(dsn,"guest","guest");
    OR DriverManager.getConnection(dsn);
    System.out.println("Conection's opened");
    catch(ClassNotFoundException cnfe)
    System.err.println(cnfe);
    catch(SQLException sqle)
    System.err.println(sqle);
    try that code and double check you DSN Name . it's a good practice to greate a system DSN.
    i hope that helps.
    FEEL FREE TO ASK. WON'T BITE U
    ABDUL

  • Problem wtih JDBC Connecting in jsf program.

    Hey guys. I have a web app setup thanks to some of you guys on here. I'm using mysql jdbc access for login. I'm using the connection pool and resource for connectivity.
    Basically what I'm asking is can I use to DataSource variables on the same page. The reason I'm asking that is. I can connect fine with the login code.
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package beans;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import javax.annotation.Resource;
    import javax.faces.context.FacesContext;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpSession;
    import javax.sql.DataSource;
    * @author Drew
    public class Login {
        @Resource(name = "jdbc/must2")
        private DataSource ds;
        private String email;
        private String password;
         * @return the email
        public String getEmail() {
            return email;
         * @param email the email to set
        public void setEmail(String email) {
            this.email = email;
         * @return the password
        public String getPassword() {
            return password;
         * @param password the password to set
        public void setPassword(String password) {
            this.password = password;
        public String VerifyUser() throws SQLException {
            if (this.email.equals("") || this.password.equals("")) {
                return "fail";
            } else {
                if (ds == null) {
                    throw new SQLException("No data source");
                Connection conn = ds.getConnection();
                if (conn == null) {
                    throw new SQLException("No connection");
                try {
                    PreparedStatement passwordQuery = conn.prepareStatement("SELECT password from user WHERE email = ?");
                    passwordQuery.setString(1, this.email);
                    ResultSet result = passwordQuery.executeQuery();
                    result.next();
                    String storedPassword = result.getString("password");
                    System.out.println(storedPassword);
                    if (this.password.equals(storedPassword)) {
                        FacesContext context = FacesContext.getCurrentInstance();
                        HttpServletRequest request = (HttpServletRequest) context.getExternalContext().getRequest();
                        HttpSession httpSession = request.getSession();
                        httpSession.setAttribute("login", "Login");
                        System.out.println("Success");
                        return "success";
                    } else {
                        return "fail";
                } finally {
                    conn.close();
                    System.out.println("Login connection closed");
    }Ok now I have some separate code that access the same database but fills a table on the same login.jspx page.
    package page;
    import java.util.ArrayList;
    import classes.Line;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.annotation.Resource;
    import javax.sql.DataSource;
    public class LineStatus {
        @Resource(name = "jdbc/must2")
        private DataSource ds;
        private ArrayList line = new ArrayList();
        public LineStatus() {
            try {
                GetLineStatus();
            } catch (SQLException ex) {
                Logger.getLogger(LineStatus.class.getName()).log(Level.SEVERE, null, ex);
        public void GetLineStatus() throws SQLException {
            if (ds == null) {
                throw new SQLException("No data source");
            Connection conn = ds.getConnection();
            if (conn == null) {
                throw new SQLException("No connection");
            try {
                PreparedStatement passwordQuery = conn.prepareStatement("SELECT DISTINCT pkg_line_id,shortname, " +
                        "line_status FROM pkg_line_tree LEFT JOIN pkg_line using (pkg_line_id) " +
                        "WHERE tree_id = ? ORDER by shortname");
                passwordQuery.setInt(1, 3075);
                System.out.println(passwordQuery);
                ResultSet result = passwordQuery.executeQuery();
                while (result.next()) {
                    line.add(new Line(58285, "Line 1", "Test", 43500, 21695));
            } finally {
                conn.close();
        public ArrayList getLine() {
            return line;
    }There is nothing wrong with the code. I checked it over and over. Even replaced this code with my same login code that works. Every time I run the page I get "no data source". Obviously becasue Datasource is null. I have setup to catch the error. I'm guessing that the two backing beans can't access the same data base on the same page. I'm not sure though. I need to figure out how to get around this. Thanks for any help guys.
    Edited by: dothedru22 on Oct 16, 2009 7:44 AM

    Anybody know? I've tried everything I can think of.

Maybe you are looking for