forked from eugenp/tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BAEL-14322] - Updated Spring JDBC Article
- Loading branch information
Showing
12 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions
7
persistence-modules/spring-persistence-simple/src/main/resources/jdbc/schema.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CREATE TABLE EMPLOYEE | ||
( | ||
ID int NOT NULL PRIMARY KEY, | ||
FIRST_NAME varchar(255), | ||
LAST_NAME varchar(255), | ||
ADDRESS varchar(255), | ||
); |
19 changes: 19 additions & 0 deletions
19
persistence-modules/spring-persistence-simple/src/main/resources/jdbc/springJdbc-config.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?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:context="http://www.springframework.org/schema/context" | ||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd | ||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd" | ||
> | ||
|
||
<bean id="employeeDao" class="org.baeldung.jdbc.EmployeeDAO"> | ||
<property name="dataSource" ref="dataSource"/> | ||
</bean> | ||
|
||
<bean id="dataSource" class="org.apache.commons.dbcp.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> | ||
|
||
<context:property-placeholder location="jdbc.properties"/> | ||
</beans> |
7 changes: 7 additions & 0 deletions
7
persistence-modules/spring-persistence-simple/src/main/resources/jdbc/test-data.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
INSERT INTO EMPLOYEE VALUES (1, 'James', 'Gosling', 'Canada'); | ||
|
||
INSERT INTO EMPLOYEE VALUES (2, 'Donald', 'Knuth', 'USA'); | ||
|
||
INSERT INTO EMPLOYEE VALUES (3, 'Linus', 'Torvalds', 'Finland'); | ||
|
||
INSERT INTO EMPLOYEE VALUES (4, 'Dennis', 'Ritchie', 'USA'); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters