Spring3 Security JDBC how to load connect info
I been working on this sample of Spring3 Security JDBC for 2 weeks now and I got it working but adding the dataSource been to the ApplicationContext but now I cant get it loading the connection inform from my file. I hard coded it and it works but I would like it to load from a file. can someone please tell me what I am missing from my AppicationContext to get it to work.. thanks
ApplicationContext-Security.xml
Changed to following and it works:Code:<beans:bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <beans:property name="driverClassName" value="${database.driver}" /> <beans:property name="url" value="${database.url}" /> <beans:property name="username" value="${database.user}" /> <beans:property name="password" value="${database.password}" /> </beans:bean>
but I dont want to hard code it. please help me.Code:<beans:bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <beans:property name="driverClassName" value="com.mysql.jdbc.Driver" /> <beans:property name="url" value="jdbc:mysql://127.0.0.1/db_mytest" /> <beans:property name="username" value="root" /> <beans:property name="password" value="" /> </beans:bean>


Reply With Quote
