Skip to main content
CollegeSource Support

uachieve-jdbc-ctx.xml or dars-jdbc-ctx.xml

In this file, you can find more specifics on the datasource definition. Use this file to add additional parameters, change to use the same datasource as the uAchieve Planner, or configure to use JNDI.

By default, we set the DARwin (darwinapi)/uachieve (uachieveapi) datasource to the following, then include in the uachieve.properties/darwin.properites file the actual configuration parameters to the datasource to be defined.

If you want to include additional properties in the datasource definition, below is where you would make the change:

	<bean id="darwinapi.dataSource"
		class="org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy">
		<property name="targetDataSource">
			<bean class="org.apache.commons.dbcp.BasicDataSource"
				destroy-method="close">
				<property name="driverClassName" value="${darwinapi.jdbc.driver}" />
				<property name="url" value="${darwinapi.jdbc.url}" />
				<property name="username" value="${darwinapi.jdbc.username}" />
				<property name="password" value="${darwinapi.jdbc.password}" />
				<property name="initialSize" value="${darwinapi.jdbc.initialNumberOfConnections}" />
				<property name="maxActive" value="${darwinapi.jdbc.maxActiveConnections}" />
				<property name="minIdle" value="${darwinapi.jdbc.minIdleConnections}" />
				<property name="maxWait" value="30000" />
			</bean>
		</property>
	</bean>

 

If you know that your uAchieve/DARwin datasource will always be the same as your Planner datasource, then you can configure this here. uAchieve Planner will use its own datasource definition for uAchieve/DARwin connections and will not look at the JDBC parameters defined in uachieve.properties/darwin.properties. Therefore, the uAchieve/DARwin tables must reside in the same database as the Planner tables. To configure your uAchieve/DARwin datasource to use the uAchieve Planner datasource, you must make sure the following line is not commented out (the comment is indicated by use of <!-- and -->):

<alias alias="darwinapi.dataSource" name="udirect.dataSource" />

 

Then, make sure the above default definition is commented out. It should look similar to this:

	<alias alias="darwinapi.dataSource" name="udirect.dataSource" /> 

<!--   
	<bean id="darwinapi.dataSource"
		class="org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy">
		<property name="targetDataSource">
			<bean class="org.apache.commons.dbcp.BasicDataSource"
				destroy-method="close">
				<property name="driverClassName" value="${darwinapi.jdbc.driver}" />
				<property name="url" value="${darwinapi.jdbc.url}" />
				<property name="username" value="${darwinapi.jdbc.username}" />
				<property name="password" value="${darwinapi.jdbc.password}" />
				<property name="initialSize" value="${darwinapi.jdbc.initialNumberOfConnections}" />
				<property name="maxActive" value="${darwinapi.jdbc.maxActiveConnections}" />
				<property name="minIdle" value="${darwinapi.jdbc.minIdleConnections}" />
				<property name="maxWait" value="30000" />
			</bean>
		</property>
	</bean>   
-->

 

To use a JNDI connection for your uAchieve/DARwin datasource, you will need to comment out the default defined datasource referenced above. Then make sure the following exists and is not commented out:

	<bean id="darwinapi.dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
    	<property name="jndiName"><value>${darwinapi.jdbc.jndi}</value></property>
  	</bean>

Once configured properly here to use JNDI, make sure the parameter is defined to the name of your JNDI connection in the associated properties file (darwinapi.jdbc.jndi or uachieveapi.jdbc.jndi), as well as following your servlet containers documentation for setting up a JNDI connection.

  • Was this article helpful?