1 Reply Latest reply on May 8, 2008 3:18 AM by mital bhatt

    database connection error

    mital bhatt Newbie

      In Spring when I use datasource as -

      <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryB ean" destroy-method="close">



      it gives me connection=null for first hit to database at second hit it works fine.

      And, when I use datasource as -








      there is no problem.

        • 1. Re: database connection error
          mital bhatt Newbie

           

          "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.