summaryrefslogtreecommitdiff
path: root/spring-framework/spring-task-manager-structure/src/main/resources
diff options
context:
space:
mode:
authorKamal Wickramanayake <kamal@inbox.lk>2026-05-10 14:23:46 +0530
committerKamal Wickramanayake <kamal@inbox.lk>2026-05-10 14:23:46 +0530
commitb1d598a2f02819bc127d0d3522dc7ac91b4dee65 (patch)
treec268db6b49531004e353c5a4ada736bb703a3b96 /spring-framework/spring-task-manager-structure/src/main/resources
parenta299226547b15de587dad614f07ce459d01f3601 (diff)
Added Spring sample application related to structure
Diffstat (limited to 'spring-framework/spring-task-manager-structure/src/main/resources')
-rw-r--r--spring-framework/spring-task-manager-structure/src/main/resources/META-INF/spring/applicationContext.xml34
-rw-r--r--spring-framework/spring-task-manager-structure/src/main/resources/META-INF/spring/jdbc.properties9
2 files changed, 43 insertions, 0 deletions
diff --git a/spring-framework/spring-task-manager-structure/src/main/resources/META-INF/spring/applicationContext.xml b/spring-framework/spring-task-manager-structure/src/main/resources/META-INF/spring/applicationContext.xml
new file mode 100644
index 0000000..abea0c7
--- /dev/null
+++ b/spring-framework/spring-task-manager-structure/src/main/resources/META-INF/spring/applicationContext.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:jdbc="http://www.springframework.org/schema/jdbc"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/jdbc
+ http://www.springframework.org/schema/jdbc/spring-jdbc.xsd
+ http://www.springframework.org/schema/context
+ http://www.springframework.org/schema/context/spring-context.xsd">
+
+ <context:property-placeholder location="classpath:META-INF/spring/jdbc.properties"/>
+
+ <bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close" >
+ <property name="driverClassName" value="${jdbc.driverClassName}"/>
+ <property name="url" value="${jdbc.url}"/>
+ <property name="username" value="${jdbc.username}"/>
+ <property name="password" value="${jdbc.password}"/>
+ </bean>
+
+ <bean id="taskDAO" class="com.example.spring.task.dao.jdbc.JDBCTaskDAO">
+ <property name="dataSource" ref="dataSource"/>
+ </bean>
+
+ <bean id="taskManager" class="com.example.spring.task.TaskManagerImpl">
+ <property name="taskDAO" ref="taskDAO"/>
+ </bean>
+
+ <bean id="textUI" class="com.example.spring.task.TextUI">
+ <property name="taskManager" ref="taskManager"/>
+ </bean>
+
+</beans> \ No newline at end of file
diff --git a/spring-framework/spring-task-manager-structure/src/main/resources/META-INF/spring/jdbc.properties b/spring-framework/spring-task-manager-structure/src/main/resources/META-INF/spring/jdbc.properties
new file mode 100644
index 0000000..c549772
--- /dev/null
+++ b/spring-framework/spring-task-manager-structure/src/main/resources/META-INF/spring/jdbc.properties
@@ -0,0 +1,9 @@
+jdbc.driverClassName=org.mariadb.jdbc.Driver
+#jdbc.url=jdbc:mysql://localhost/bankdb?useSSL=false
+#jdbc.url=jdbc:mysql://localhost/bankdb?useLegacyDatetimeCode=false&serverTimezone=UTC
+jdbc.url=jdbc:mariadb://localhost/bank?serverTimezone=Asia/Colombo
+jdbc.username=bankuser
+jdbc.password=bankpwd
+
+#jdbc.driverClassName=org.postgresql.Driver
+#jdbc.url=jdbc:postgresql://localhost/bank