This content has been marked as final.
Show 1 reply
-
1. Re: database connection error
mitali May 8, 2008 3:18 AM (in response to mitali)"mitali" wrote:
In Spring when I use datasource as -
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryB ean" destroy-method="close">
<property name="jndiName" value="java:SmartLMSDB" />
<property name="resourceRef" value="true" />
</bean>
it gives me connection=null for first hit to database at second hit it works fine.
And, when I use datasource as -
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverM anagerDataSource" >
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://10.20.10.7/SmartLMS"/>
<property name="username" value="SmartLMS"/>
<property name="password" value="SmartLMS"/>
</bean>
there is no problem.