Pom.xml
<!--Mysql-jar Package--<Dependency> <groupId>org.wisdom-framework</groupId> <Artifactid>mysql-connector-java</Artifactid> <version>5.1.34_1</version> </Dependency> <!--Spring Configuration-Provides extended services on basic IOC functionality, plus support for many enterprise-class services, with mail services, task scheduling, jndi positioning, EJB integration, remote access, caching, and support for multiple view layer frameworks--<Dependency> <groupId>org.springframework</groupId> <Artifactid>spring-context</Artifactid> <version>4.2.0.release</version> </Dependency> <!--jar--> for AOP use <Dependency> <groupId> org.aspectj</groupId > <Artifactid> aspectjweaver</Artifactid > <version> 1.8.7</version > </Dependency> <!--springweb-contains the core classes required to use the spring framework when developing Web applications, including classes that automatically load Webapplicationcontext features, struts and JSF integration classes, File upload support classes, Filter class and a large number of tool helper classes. -<Dependency> <groupId>org.springframework</groupId> <Artifactid>spring-web</Artifactid> <version>4.1.8.release</version> </Dependency> <!--javaee--> <Dependency> <groupId>javaee</groupId> <Artifactid>javaee-api</Artifactid> <version>5</version> </Dependency> <Dependency> <groupId>javax.servlet</groupId> <Artifactid>jstl</Artifactid> <version>1.2</version> <Scope>runtime</Scope> </Dependency> <Dependency> <groupId>org.springframework</groupId> <Artifactid>spring-tx</Artifactid> <version>4.2.5.release</version> </Dependency> <!--c3p0--> <Dependency> <groupId>com.mchange</groupId> <Artifactid>c3p0</Artifactid> <version>0.9.5.2</version> </Dependency> <!--hibernate jar---<!--JTA Jar--<Dependency> <groupId>javax.transaction</groupId> <Artifactid>jta</Artifactid> <version>1.1</version> </Dependency> <!--<dependency> <groupId>org.hibernate</groupId> <artifactid>hiber nate-core</artifactid> <version>5.0.6.Final</version> </dependency>--> <!- -spring-orm integrates third-party ORM implementations, such as HIBERNATE,IBATIS,JDO and Spring JPA implementations-<Dependency> <groupId>org.springframework</groupId> <Artifactid>spring-orm</Artifactid> <version> 4.2.2.release</version> </Dependency> <!--springwebmvc--> <Dependency> <groupId>org.springframework</groupId> <Artifactid>spring-webmvc</Artifactid> <version>3.2.13.release</version> </Dependency> <Dependency> <groupId>org.hibernate</groupId> <Artifactid>hibernate-core</Artifactid> <version>5.2.10.final</version> </Dependency> <Dependency> <groupId>junit</groupId> <Artifactid>junit</Artifactid> <version>release</version> </Dependency> <!--https://mvnrepository.com/artifact/org.apache.struts.xwork/xwork-core--<!--struts2-jar--> <Dependency> <groupId>org.apache.struts</groupId> <Artifactid>struts2-core</Artifactid> <version>2.3.4.1</version> </Dependency> <Dependency> <groupId>org.apache.struts.xwork</groupId> <Artifactid>xwork-core</Artifactid> <version>2.3.4.1</version> </Dependency> <!--struts integrate spring jar--<Dependency> <groupId>org.apache.struts</groupId> <Artifactid>struts2-spring-plugin</Artifactid> <version>2.3.4.1</version> </Dependency> <!--Struts2 annotations support jar--<Dependency> <groupId>org.apache.struts</groupId> <Artifactid>struts2-convention-plugin</Artifactid> <version>2.3.4.1</version> </Dependency>
Entity class:
Dept {
deptno;
deptname;
Integer Getdeptno () {
deptno;
}
Setdeptno (Integer deptno) {This
. = Deptno;
}
String getdeptname () {
deptname;
}
setdeptname (String deptname) {This
. = Deptname;
}
}
Dao:
Interface:
Adddept (Dept Dept);
Interface implementation: