[cas-dev] Configure a database access.

shivanic shivani.chandna at gmail.com
Tue Jun 3 02:52:43 EDT 2008


Hi Alvaro,
You can use the spring configuration to auto inject the values of your db
configuration in your bean class. 

Example: If you modify cas.properties and add the properties  
jdbc.url=localhost  
jdbc.user=test 
jdbc.password=test 

And we already have the 
org.springframework.beans.factory.config.PropertyPlaceholderConfigurer to
load cas.properties  declared in cas-servlet.xml

So, if you define datasource bean as the following cas-servlet.xml - the
values will be auto injected by Spring.

<bean id="dbAccess" 
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="username"><value>${jdbc.user}</value></property>
 ....
</bean>
 
Refer this bean in your own bean definition which has the logic to use the
datasource.

-Shivani.



Álvaro Manso Gutiérrez wrote:
> 
> Hi,
> I have created a filter for blocking users with several attempts failed.
> The user list is stored in a data base;
> my question is where should I configure the database access (url, user,
> pwd,
> ....)??, at this moment I have it hardcoded for testing the logic.
> Obviouslly I must have a configuration file, such as cas.properties. Is
> there any object for access to the properties file or I have to create a
> new
> one?
> The database must be accesible during the login flow.
> 
> _______________________________________________
> cas-dev mailing list
> cas-dev at tp.its.yale.edu
> http://tp.its.yale.edu/mailman/listinfo/cas-dev
> 
> 

-- 
View this message in context: http://www.nabble.com/Configure-a-database-access.-tp17469027p17617108.html
Sent from the CAS Dev mailing list archive at Nabble.com.



More information about the cas-dev mailing list