0

In order to store Session to database, I wrote the following code:

    <Manager className='org.apache.catalina.session.PersistentManager'
            maxIdleBackup='1'>
            <Store className="org.apache.catalina.session.JDBCStore"
                driverName=""
                connectionURL=""
                sessionTable="sessions"
                sessionIdCol="session_id"
                sessionDataCol="session_data"
                sessionValidCol="valid_session" 
                sessionMaxInactiveCol="max_inactive"
                sessionLastAccessedCol="last_access"
                sessionAppCol='app_name' />
   </Manager>

Now I need to load the driverName and connectionURL from an external jdbc.properties file to ensure portability. How can I do this?


**jdbc.properties**

jdbc.driverClassName=org.postgresql.Driver
jdbc.url=jdbc:postgresql://localhost:5432/myDB
jdbc.username=postgres
jdbc.password=root
Vishnu G S
  • 654
  • 2
  • 10
  • 27
  • Follow below link. 1.http://stackoverflow.com/questions/11468881/externalize-tomcat-configuration 2.http://stackoverflow.com/questions/13238770/how-to-dynamically-load-values-into-tomcats-context-xml-file – dReAmEr Sep 30 '14 at 13:52
  • I followed the post mentioned above. Can I user a bean id instead of class for factory? – Vishnu G S Oct 01 '14 at 04:59

0 Answers0