Manish
asked on
Datasource
Hi,
Currently we are using followign class for datasource in java application.(db is Oracle)
org.springframework.jndi.J ndiObjectF actoryBean
But it is getting failed
weblogic.jdbc.rmi.internal .Connectio nImpl_webl ogic_jdbc_ wrapper_JT AConnectio n_weblogic _jdbc_wrap per_XAConn ection_ora cle_jdbc_d river_Logi calConnect ion_816_WL Stub .
Then We have used,
org.springframework.jdbc.d atasource. SingleConn ectionData Source
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
Currently we are using followign class for datasource in java application.(db is Oracle)
org.springframework.jndi.J
But it is getting failed
weblogic.jdbc.rmi.internal
Then We have used,
org.springframework.jdbc.d
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
Thanks for input.
-/Karan
ASKER
Failing when we are using following entry.
<bean id="myDatasource" class="org.springframework .jndi.Jndi ObjectFact oryBean">
<property name="jndiName"><value>${j ndiName}</ value></pr operty>
<property name="jndiEnvironment">
<props>
<prop key="java.naming.factory.i nitial">we blogic.jnd i.WLInitia lContextFa ctory</pro p>
<prop key="java.naming.provider. url">${url }</prop>
<prop key="java.naming.security. principal" >${princip al}</prop>
<prop key="java.naming.security. credential s">${crede ntials}</p rop>
</props>
</property>
</bean>
<bean id="myDatasource" class="org.springframework
<property name="jndiName"><value>${j
<property name="jndiEnvironment">
<props>
<prop key="java.naming.factory.i
<prop key="java.naming.provider.
<prop key="java.naming.security.
<prop key="java.naming.security.
</props>
</property>
</bean>
it seems some mismatch is going between weblogic JNDI and oracle driver jars.
http://forum.springsource.org/showthread.php?43911-TypeMismatchException-using-WebLogic-XA-datasource-and-Oracle-driver
http://forum.springsource.org/showthread.php?43911-TypeMismatchException-using-WebLogic-XA-datasource-and-Oracle-driver
ASKER
I am not sure about drivers.
what abt this q?
2. Is it ok to use SingleConnectionDataSource or should we use DriverManagerDataSource?
what abt this q?
2. Is it ok to use SingleConnectionDataSource
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
First q answer is not clear.
http://forum.springsource.org/showthread.php?13984-How-to-create-a-jndi-using-spring-datasource
http://www.java2s.com/Code/Java/Spring/SetupDataSourceforOracle.htm
http://www.vaannila.com/spring/spring-jdbc-tutorial-1.html
http://stackoverflow.com/questions/1561209/how-to-define-spring-datasource-in-controller
http://www.mkyong.com/spring/maven-spring-jdbc-example/