We help IT Professionals succeed at work.

Datasource

Manish
Manish asked
on
Hi,
   Currently we are using followign class for datasource in java application.(db is Oracle)
org.springframework.jndi.JndiObjectFactoryBean
But it is getting failed
weblogic.jdbc.rmi.internal.ConnectionImpl_weblogic_jdbc_wrapper_JTAConnection_weblogic_jdbc_wrapper_XAConnection_oracle_jdbc_driver_LogicalConnection_816_WLStub .

Then We have used,
org.springframework.jdbc.datasource.SingleConnectionDataSource

so it is working fine.

My Query is-
1. Is there any solution for error what we have got?
2. Is it ok to use SingleConnectionDataSource or  should we use DriverManagerDataSource?

Thanks for input.

-/Karan


Comment
Watch Question

ManishLead
CERTIFIED EXPERT

Author

Commented:
Failing when we are using following entry.

<bean id="myDatasource" class="org.springframework.jndi.JndiObjectFactoryBean">
            <property name="jndiName"><value>${jndiName}</value></property>
            <property name="jndiEnvironment">
                  <props>
                        <prop key="java.naming.factory.initial">weblogic.jndi.WLInitialContextFactory</prop>
                        <prop key="java.naming.provider.url">${url}</prop>
                        <prop key="java.naming.security.principal">${principal}</prop>
                                <prop key="java.naming.security.credentials">${credentials}</prop>
                         </props>
            </property>
      </bean>
ManishLead
CERTIFIED EXPERT

Author

Commented:
I am not sure about drivers.
what abt this q?
2. Is it ok to use SingleConnectionDataSource or  should we use DriverManagerDataSource?

use DriverManagerDataSource
ManishLead
CERTIFIED EXPERT

Author

Commented:
First q answer is not clear.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.