1 | 2
This example shows how to integrate Spring and JDBC using DaoSupport class (JdbcDaoSupport Class). This example is same as JdbcTemplate example, only dao has been changed to implement JdbcDaoSupport class instead of JdbcTemplate.
You may want to refer Spring - JDBC Integration (Part-2) to read about JdbcDaoSupport classes.
Technology Used
1) Spring 3.0.6-Release
2) JDBC
3) Eclipse Helios
4) Java Se 6
5) MySql 5.1
Project Structure
Project Structure in Eclipse
Jars Needed
org.springframework.jdbc-3.0.6.RELEASE.jar
org.springframework.transaction-3.0.6.RELEASE.jar
org.springframework.core-3.0.6.RELEASE.jar
org.springframework.context-3.0.6.RELEASE.jar
org.springframework.beans-3.0.6.RELEASE.jar
commons-logging-1.1.1.jar
org.springframework.asm-3.0.6.RELEASE.jar
org.springframework.expression-3.0.6.RELEASE.jar
commons-dbcp-1.3.jar
commons-pool-1.5.7.jar
mysql-connector-java-5.1.12-bin.jar
MySQl Database Structure
CREATE TABLE examples.issue(
tid INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
assigned_to VARCHAR(255) NOT NULL,
assigned_by VARCHAR(255) NOT NULL,
status VARCHAR(255) NOT NULL,
PRIMARY KEY (tid)
)
ENGINE = INNODB
AUTO_INCREMENT = 129
AVG_ROW_LENGTH = 268
CHARACTER SET latin1
COLLATE latin1_swedish_ci;
1 | 2
This example shows how to integrate Spring and JDBC using DaoSupport class (JdbcDaoSupport Class). This example is same as JdbcTemplate example, only dao has been changed to implement JdbcDaoSupport class instead of JdbcTemplate.
You may want to refer Spring - JDBC Integration (Part-2) to read about JdbcDaoSupport classes.
Technology Used
1) Spring 3.0.6-Release
2) JDBC
3) Eclipse Helios
4) Java Se 6
5) MySql 5.1
Project Structure
Project Structure in Eclipse
Jars Needed
org.springframework.jdbc-3.0.6.RELEASE.jar
org.springframework.transaction-3.0.6.RELEASE.jar
org.springframework.core-3.0.6.RELEASE.jar
org.springframework.context-3.0.6.RELEASE.jar
org.springframework.beans-3.0.6.RELEASE.jar
commons-logging-1.1.1.jar
org.springframework.asm-3.0.6.RELEASE.jar
org.springframework.expression-3.0.6.RELEASE.jar
commons-dbcp-1.3.jar
commons-pool-1.5.7.jar
mysql-connector-java-5.1.12-bin.jar
MySQl Database Structure
CREATE TABLE examples.issue(
tid INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
assigned_to VARCHAR(255) NOT NULL,
assigned_by VARCHAR(255) NOT NULL,
status VARCHAR(255) NOT NULL,
PRIMARY KEY (tid)
)
ENGINE = INNODB
AUTO_INCREMENT = 129
AVG_ROW_LENGTH = 268
CHARACTER SET latin1
COLLATE latin1_swedish_ci;
1 | 2
I would like to know your comments and if you liked the article then please share it on social networking buttons.
great
ReplyDelete