title: Passing hibernate.connection.datasource from Spring's applicationContext xml
body: <p>Earlier I had datasource configured in the application server itself and I am passing it to application level hbr.xml file as </p>
  
  <pre><code>&lt;property name="hibernate.connection.datasource"&gt;java:comp/env/jdbc/myDataSource&lt;/property&gt;
  </code></pre>
  
  <p>Now I have configured datasource in applicationContext.xml as </p>
  
  <pre><code>&lt;bean id="mydatasource"
          class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt;
              &lt;property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver" /&gt;
              &lt;property name="url"
                  value="jdbc:sqlserver://localhost:1433;databaseName=mydatasource;maxPoolSize=100" /&gt;
              &lt;property name="username" value="sa" /&gt;
              &lt;property name="password" value="${database.password}"/&gt;
  
      &lt;/bean&gt;
  </code></pre>
  
  <p>How to pass this to hbr.xml file?
  Based on the given below my another question is that what should be the class for my session factory? Should it be <code>org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean</code>
  OR</p>
  
  <pre><code>org.springframework.orm.hibernate3.LocalSessionFactoryBean
  </code></pre>