title: 404 Not Found:The origin server did not find a current representation for the target resource or is not willing to disclose that one exists
body: <blockquote>
    <p>This is the error I am getting I am using Gradle as build tool I have tried all the solutions 
      on internet </p>
  </blockquote>
  
  <pre><code>Oct 24, 2019 3:01:35 PM org.apache.catalina.startup.VersionLoggerListener log
   INFO: Server version name:   Apache Tomcat/9.0.27
   Oct 24, 2019 3:01:35 PM org.apache.catalina.startup.VersionLoggerListener log
   INFO: Server built:          Oct 7 2019 09:57:22 UTC
   Oct 24, 2019 3:01:35 PM org.apache.catalina.startup.VersionLoggerListener log
  INFO: Server version number: 9.0.27.0
  Oct 24, 2019 3:01:35 PM org.apache.catalina.startup.VersionLoggerListener log
  INFO: OS Name:               Linux
  Oct 24, 2019 3:01:35 PM org.apache.catalina.startup.VersionLoggerListener log
  INFO: OS Version:            5.0.0-32-generic
  Oct 24, 2019 3:01:35 PM org.apache.catalina.startup.VersionLoggerListener log
  INFO: Architecture:          amd64
  Oct 24, 2019 3:01:35 PM org.apache.catalina.startup.VersionLoggerListener log
  INFO: Java Home:             /usr/lib/jvm/java-8-openjdk-amd64/jre
  Oct 24, 2019 3:01:35 PM org.apache.catalina.startup.VersionLoggerListener log
  INFO: JVM Version:           1.8.0_222-8u222-b10-1ubuntu1~18.04.1-b10
  Oct 24, 2019 3:01:35 PM org.apache.catalina.startup.VersionLoggerListener log
  INFO: JVM Vendor:            Private Build
  Oct 24, 2019 3:01:35 PM org.apache.catalina.startup.VersionLoggerListener log
  INFO: CATALINA_BASE:         
  /home/sudarshan/work/.metadata/.plugins/org.eclipse.wst.server.core/tmp1
  Oct 24, 2019 3:01:35 PM org.apache.catalina.startup.VersionLoggerListener log
  INFO: CATALINA_HOME:         /home/sudarshan/Downloads/apache-tomcat-9.0.27
  Oct 24, 2019 3:01:35 PM org.apache.catalina.startup.VersionLoggerListener log
  INFO: Command line argument: - 
  Dcatalina.base=/home/sudarshan/work/.metadata/.plugins/org.eclipse.wst.server.core/tmp1
  Oct 24, 2019 3:01:35 PM org.apache.catalina.startup.VersionLoggerListener log
  INFO: Command line argument: -Dcatalina.home=/home/sudarshan/Downloads/apache-tomcat-9.0.27
  Oct 24, 2019 3:01:35 PM org.apache.catalina.startup.VersionLoggerListener log
  INFO: Command line argument: - 
  Dwtp.deploy=/home/sudarshan/work/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/
   wtpwebapps
  Oct 24, 2019 3:01:35 PM org.apache.catalina.startup.VersionLoggerListener log
  INFO: Command line argument: -Djava.endorsed.dirs=/home/sudarshan/Downloads/apache-tomcat- 
    9.0.27/endorsed
  Oct 24, 2019 3:01:35 PM org.apache.catalina.startup.VersionLoggerListener log
  INFO: Command line argument: -Dfile.encoding=UTF-8
  Oct 24, 2019 3:01:35 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
  INFO: The APR based Apache Tomcat Native library which allows optimal performance in 
  production environments was not found on the java.library.path: 
  [/usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux- 
  gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib]
  Oct 24, 2019 3:01:35 PM org.apache.coyote.AbstractProtocol init
  INFO: Initializing ProtocolHandler ["http-nio-2016"]
  Oct 24, 2019 3:01:35 PM org.apache.coyote.AbstractProtocol init
  INFO: Initializing ProtocolHandler ["ajp-nio-8009"]
  Oct 24, 2019 3:01:35 PM org.apache.catalina.startup.Catalina load
  INFO: Server initialization in [549] milliseconds
  Oct 24, 2019 3:01:35 PM org.apache.catalina.core.StandardService startInternal
  INFO: Starting service [Catalina]
  Oct 24, 2019 3:01:35 PM org.apache.catalina.core.StandardEngine startInternal
  INFO: Starting Servlet engine: [Apache Tomcat/9.0.27]
  Oct 24, 2019 3:01:36 PM org.apache.catalina.core.ApplicationContext log
  INFO: No Spring WebApplicationInitializer types detected on classpath
  Oct 24, 2019 3:01:37 PM org.apache.jasper.servlet.TldScanner scanJars
  INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for 
  this logger for a complete list of JARs that were scanned but no TLDs were found in them. 
  Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
  Oct 24, 2019 3:01:37 PM org.apache.catalina.core.StandardContext listenerStart
  SEVERE: Error configuring application listener of class 
  [org.springframework.web.context.ContextLoaderListener]
  java.lang.NoClassDefFoundError: 
  Lorg/springframework/beans/factory/access/BeanFactoryReference;
  at java.lang.Class.getDeclaredFields0(Native Method)
  at java.lang.Class.privateGetDeclaredFields(Class.java:2583)
  at java.lang.Class.getDeclaredFields(Class.java:1916)
  at org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:110)
  at org.apache.catalina.core.DefaultInstanceManager.populateAnnotationsCache
  (DefaultInstanceManager.java:402)
  at 
  
  org.apache.catalina.core.DefaultInstanceManager.newInstance
  (DefaultInstanceManager.java:173)
  at org.apache.catalina.core.DefaultInstanceManager.newInstance
  (DefaultInstanceManager.java:151)
  at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4607)
  at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5146)
  at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
  at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
  at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
  at 
  org.apache.tomcat.util.threads.InlineExecutorService.execute
  (InlineExecutorService.java:75)
  at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
  at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
  at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:841)
  at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
  at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
  at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
  at  org.apache.tomcat.util.threads.InlineExecutorService.execute
      (InlineExecutorService.java:75)
      at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
      at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
      at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      at org.apache.catalina.core.StandardService.startInternal(StandardService.java:421)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:633)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:344)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:475)
     Caused by: java.lang.ClassNotFoundException: 
    org.springframework.beans.factory.access.BeanFactoryReference
      at 
  org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1365)
      at 
  org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1188)
      ... 37 more
  
  Oct 24, 2019 3:01:37 PM org.apache.catalina.core.StandardContext listenerStart
  SEVERE: Skipped installing application listeners due to previous error(s)
  Oct 24, 2019 3:01:37 PM org.apache.catalina.core.StandardContext startInternal
  SEVERE: One or more listeners failed to start. Full details will be found in the appropriate 
  container log file
  Oct 24, 2019 3:01:37 PM org.apache.catalina.core.StandardContext startInternal
  SEVERE: Context [/HibernateTemplate] startup failed due to previous errors
  Oct 24, 2019 3:01:37 PM org.apache.catalina.core.ApplicationContext log
  INFO: No Spring WebApplicationInitializer types detected on classpath
  Oct 24, 2019 3:01:37 PM org.apache.jasper.servlet.TldScanner scanJars
  INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for 
  this logger for a complete list of JARs that were scanned but no TLDs were found in them. 
  Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
  Oct 24, 2019 3:01:37 PM org.apache.catalina.core.ApplicationContext log
  INFO: Initializing Spring root WebApplicationContext
  Oct 24, 2019 3:01:37 PM org.springframework.web.context.ContextLoader 
  initWebApplicationContext
  INFO: Root WebApplicationContext: initialization started
  Oct 24, 2019 3:01:37 PM org.springframework.context.support.AbstractApplicationContext 
  prepareRefresh
  INFO: Refreshing Root WebApplicationContext: startup date [Thu Oct 24 15:01:37 IST 2019]; 
  root of context hierarchy
  Oct 24, 2019 3:01:38 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader 
  loadBeanDefinitions
  INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/spring-core- 
   config.xml]
  Oct 24, 2019 3:01:38 PM org.springframework.web.context.ContextLoader 
  initWebApplicationContext
  INFO: Root WebApplicationContext: initialization completed in 188 ms
  Oct 24, 2019 3:01:38 PM org.apache.catalina.core.ApplicationContext log
  INFO: Initializing Spring FrameworkServlet 'springDispatcherServlet'
  Oct 24, 2019 3:01:38 PM org.springframework.web.servlet.FrameworkServlet initServletBean
  INFO: FrameworkServlet 'springDispatcherServlet': initialization started
  Oct 24, 2019 3:01:38 PM org.springframework.context.support.AbstractApplicationContext 
   prepareRefresh
  INFO: Refreshing WebApplicationContext for namespace 'springDispatcherServlet-servlet': 
  startup date [Thu Oct 24 15:01:38 IST 2019]; parent: Root WebApplicationContext
  Oct 24, 2019 3:01:38 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader 
  loadBeanDefinitions
  INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/spring-mvc- 
   config.xml]
  Oct 24, 2019 3:01:38 PM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping 
  registerHandler
  INFO: Root mapping to handler 'homeController'
  Oct 24, 2019 3:01:38 PM org.springframework.web.servlet.FrameworkServlet initServletBean
  INFO: FrameworkServlet 'springDispatcherServlet': initialization completed in 425 ms
  Oct 24, 2019 3:01:38 PM org.apache.coyote.AbstractProtocol start
  INFO: Starting ProtocolHandler ["http-nio-2016"]
  Oct 24, 2019 3:01:38 PM org.apache.coyote.AbstractProtocol start
  INFO: Starting ProtocolHandler ["ajp-nio-8009"]
  Oct 24, 2019 3:01:38 PM org.apache.catalina.startup.Catalina start
  INFO: Server startup in [2,794] milliseconds
  </code></pre>
  
  <blockquote>
    <p>This is my build.gradle where I have added required dependencies</p>
  </blockquote>
  
  <pre><code>plugins {
  // Apply the java-library plugin to add support for Java Library
  id 'java-library'
  id 'war'
  id 'org.gretty' version '2.3.1'
  }
  
   repositories {
  
      jcenter()
  }
  
  dependencies {
  
      // This dependency is exported to consumers, that is to say found on their compile 
   classpath.
  api 'org.apache.commons:commons-math3:3.6.1'
  
  // This dependency is used internally, and not exposed to consumers on their own compile 
  classpath.
  implementation 'com.google.guava:guava:28.0-jre'
  
  // https://mvnrepository.com/artifact/org.springframework/spring-web
  compile group: 'org.springframework', name: 'spring-web', version: '4.3.13.RELEASE'
  
  // https://mvnrepository.com/artifact/org.springframework/spring-webmvc
  compile group: 'org.springframework', name: 'spring-webmvc', version: '4.3.14.RELEASE'
  
  // https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api
  providedCompile group: 'javax.servlet', name: 'javax.servlet-api', version: '4.0.1'
  
  // https://mvnrepository.com/artifact/javax.servlet/jstl
  compile group: 'javax.servlet', name: 'jstl', version: '1.2'
  
  // https://mvnrepository.com/artifact/mysql/mysql-connector-java
  compile group: 'mysql', name: 'mysql-connector-java', version: '8.0.13'
  
  // https://mvnrepository.com/artifact/org.springframework/spring-jdbc
  compile group: 'org.springframework', name: 'spring-jdbc', version: '5.1.5.RELEASE'
  
  // https://mvnrepository.com/artifact/org.springframework/spring-beans
  compile group: 'org.springframework', name: 'spring-beans', version: '5.1.5.RELEASE'
  
  
  
  
  
  // Use JUnit test framework
  testImplementation 'junit:junit:4.12'
  }
  </code></pre>
  
  <blockquote>
    <p>This is my spring-core-config.xml</p>
  </blockquote>
  
  <pre><code>&lt;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"  
  xmlns:mvc="http://www.springframework.org/schema/mvc"  
  xsi:schemaLocation="  
      http://www.springframework.org/schema/beans  
      http://www.springframework.org/schema/beans/spring-beans.xsd  
      http://www.springframework.org/schema/context  
      http://www.springframework.org/schema/context/spring-context.xsd  
      http://www.springframework.org/schema/mvc  
      http://www.springframework.org/schema/mvc/spring-mvc.xsd"&gt;
      &lt;/beans&gt;
  </code></pre>
  
  <blockquote>
    <p>This is my spring-mvc-config.xml</p>
  </blockquote>
  
  <pre><code>&lt;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"  
  xmlns:mvc="http://www.springframework.org/schema/mvc"  
  xsi:schemaLocation="  
      http://www.springframework.org/schema/beans  
      http://www.springframework.org/schema/beans/spring-beans.xsd  
      http://www.springframework.org/schema/context  
      http://www.springframework.org/schema/context/spring-context.xsd  
      http://www.springframework.org/schema/mvc  
      http://www.springframework.org/schema/mvc/spring-mvc.xsd"&gt;  
  
   &lt;context:component-scan base-package="HibernateTemplate"&gt;&lt;/context:component-scan&gt;
  
   &lt;bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
   &lt;property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/&gt;
  &lt;property name="prefix" value="/WEB-INF/views/"/&gt;
  &lt;property name="suffix" value=".jsp"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="ds" class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt;    
  &lt;property name="driverClassName" value="com.mysql.jdbc.Driver"&gt;&lt;/property&gt;    
  &lt;property name="url" value="jdbc:mysql://localhost:3306/userdb"&gt;&lt;/property&gt;    
  &lt;property name="username" value="root"&gt;&lt;/property&gt;    
  &lt;property name="password" value="password"&gt;&lt;/property&gt;    
  &lt;/bean&gt;    
  
  &lt;bean id="jt" class="org.springframework.jdbc.core.JdbcTemplate"&gt;    
  &lt;property name="dataSource" ref="ds"&gt;&lt;/property&gt;    
  &lt;/bean&gt;    
  
  &lt;bean id="dao" class="HibernateTemplate.StudentDao"&gt;    
  &lt;property name="template" ref="jt"&gt;&lt;/property&gt;    
  &lt;/bean&gt;
  
  
  &lt;/beans&gt;
  </code></pre>
  
  <blockquote>
    <p>This is my  web.xml</p>
  </blockquote>
  
  <pre><code>&lt;web-app xmlns="http://java.sun.com/xml/ns/javaee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web- 
  app_3_0.xsd" 
  id="WebApp_ID" version="3.0"&gt;
  
  &lt;display-name&gt;web application&lt;/display-name&gt;
  &lt;!-- The front controller of this Spring Web application, responsible for handling all 
   application requests --&gt;
  
  &lt;servlet&gt;
      &lt;servlet-name&gt;springDispatcherServlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;/WEB-INF/spring-mvc-config.xml&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  
  &lt;!-- Map all requests to the DispatcherServlet for handling --&gt;
  
     &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;springDispatcherServlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  
  &lt;listener&gt;
      &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
  &lt;/listener&gt;
  
  &lt;context-param&gt;
      &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
      &lt;param-value&gt;/WEB-INF/spring-core-config.xml&lt;/param-value&gt;
   &lt;/context-param&gt;
  
   &lt;/web-app&gt;
  </code></pre>
  
  <blockquote>
    <p>This is my index.jsp </p>
  </blockquote>
  
  <pre><code>&lt;%@ page language="java" contentType="text/html; charset=UTF-8"
  pageEncoding="UTF-8"%&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
  "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
  &lt;title&gt;Insert title here&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;a href="empform"&gt;Add Employee&lt;/a&gt;  
  &lt;!-- &lt;a href="viewemp"&gt;View Employees&lt;/a&gt;  --&gt;  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <blockquote>
    <p>studform.jsp file where I have created form to take values. </p>
  </blockquote>
  
  <pre><code>&lt;%@ page language="java" contentType="text/html; charset=UTF-8"
  pageEncoding="UTF-8"%&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
  "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
  &lt;title&gt;Insert title here&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;a href="empform"&gt;Add Employee&lt;/a&gt;  
    &lt;!-- &lt;a href="viewemp"&gt;View Employees&lt;/a&gt;  --&gt;  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <blockquote>
    <p>index.jsp page</p>
  </blockquote>
  
  <pre><code>&lt;%@ page language="java" contentType="text/html; charset=UTF-8"
  pageEncoding="UTF-8"%&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
  "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
  &lt;title&gt;Insert title here&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;a href="empform"&gt;Add Employee&lt;/a&gt;  
    &lt;!-- &lt;a href="viewemp"&gt;View Employees&lt;/a&gt;  --&gt;  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <blockquote>
    <p>Student.java class</p>
  </blockquote>
  
  <pre><code>package HibernateTemplate;
  
  public class Student {
  
  private int id;
  private String name;
  private String email;
  
  public int getId() {
      return id;
  }
  public void setId(int id) {
      this.id = id;
  }
  public String getName() {
      return name;
  }
  public void setName(String name) {
      this.name = name;
  }
  public String getEmail() {
      return email;
  }
  public void setEmail(String email) {
      this.email = email;
  }
  
  
  }
  </code></pre>
  
  <blockquote>
    <p>StudentController class</p>
  </blockquote>
  
  <pre><code>package HibernateTemplate;
  
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.stereotype.Controller;
  import org.springframework.ui.Model;
  import org.springframework.web.bind.annotation.ModelAttribute;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RequestMethod;
  import HibernateTemplate.Student;
  import HibernateTemplate.StudentDao;
  
  @Controller
  public class StudentController {
  
  @Autowired
  
  StudentDao dao;
  
  /*It displays a form to input data, here "command" is a reserved request attribute  
   which is used to display object data into form   */   
  
  @RequestMapping("/studform")    
  public String showform(Model m){    
      m.addAttribute("command", new Student());  
      return "studform";   
  }
  
  /*It saves object into database. The @ModelAttribute puts request data into model object. 
   *You need to mention RequestMethod.POST method   
    because default request is GET*/    
  
  @RequestMapping(value="/save",method = RequestMethod.POST)    
  public String save(@ModelAttribute("std") Student std){    
      dao.save(std);    
      return "save"; //will redirect to viewemp request mapping    
  }   
  
  }
  </code></pre>
  
  <blockquote>
    <p>StudentDao class</p>
  </blockquote>
  
  <pre><code>package HibernateTemplate;
  
  import org.springframework.jdbc.core.JdbcTemplate;
  
  public class StudentDao {
  
      JdbcTemplate template; 
  
      public void setTemplate(JdbcTemplate template) {    
          this.template = template;    
      }  
  
      public int save(Student s){    
          String sql="insert into student(id,name,email) 
          values('"+s.getId()+"',"+s.getName()+",'"+s.getEmail()+"')";    
          return template.update(sql);   
      } 
  
  }
  </code></pre>
  
  <blockquote>
    <p>I just needs to connect with database so that I can go ahead and do further operations, also 
      you can recommend me book where I can learn spring MVC using gradle as there is no gradle 
      stuff available on internet. </p>
  </blockquote>