Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Great work on all your tutorials ! I am mainly a c++ guy trying to learn spring However on this one I am getting several build errors in STS of type - Multiple markers at this line - The method save(Employee) of type EmployeeDAOJDBCTemplateImpl must override a superclass method - implements com.journaldev.spring.jdbc.dao.EmployeeDAO.save thanks a lot
- akg
Cannot make a static reference to the non-static method save(Employee) from the type EmployeeInterface…is the error which i m geting. coukld u plz help me to resolve this error???
- nithesh
Where do you put the Employee.sql? How do you create the db for that?
- Tricia
Friend thanks a lot for sharing, I have not taken the time to try because although it looks like a very good tutorial, the starting point in STS is always missing. Not enough to show the structure, STS has too many projects and it is hard to figure out which one to use for your tutorial. You could say for example “New-Spring-SpringMVC-create project.”.
- Kofi
How can integrate it in a Spring Web Application? For example in my class called “Home Controller”: */ @RequestMapping(value = “/”, method = RequestMethod.GET) public String home(Locale locale, Model model) { //Get the Spring Context ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(“spring.xml”); //Get the EmployeeDAO Bean //EmployeeDAO employeeDAO = ctx.getBean(“employeeDAO”, EmployeeDAO.class); //To use JdbcTemplate EmployeeDAO employeeDAO = ctx.getBean(“employeeDAOJDBCTemplate”, EmployeeDAO.class); //Run some tests for JDBC CRUD operations Employee emp = new Employee(); int rand = new Random().nextInt(1000); emp.setId(rand); emp.setName(“Pankaj”); emp.setRole(“Java Developer”); //Create employeeDAO.save(emp); ctx.close(); return “home”; } This code return the follow error in Tomcat Server: Exception in thread “main” java.lang.NoClassDefFoundError: Could not initialize class org.springframework.jdbc.core.StatementCreatorUtils at org.springframework.jdbc.core.ArgumentPreparedStatementSetter.cleanupParameters(ArgumentPreparedStatementSetter.java:72) at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:924) at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:909) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:644) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:909) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:970) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:980) at com.journaldev.spring.jdbc.dao.EmployeeDAOJDBCTemplateImpl.save(EmployeeDAOJDBCTemplateImpl.java:32)
- Tony
Hi- Thanks a lot for this post. Clear, loud and helpful. Thank you again :-) I am new to Spring
- Kholofelo Maloma
Hi, Thank you for your tutorial. I am following your tutorial. But I am using mssql 2012 DB. Could you please tell me the changes i should made for MS SQL 2012 compability?
- Monirul Islam
thanks for the example, but could you explain how to do it with a join? For example, if we have two tables: Employees and Salary and we want to join them on their id to get salararies for each employee, how should be the Model class? It just has to have all the fields that we use in sql Select and all the rest logic remains the same?
- oak
Hello Sir, I always follow your tutorials. Thanks for sharing such a great knowledge. While running above project, the values are not getting reflect into the database. I am using Oracle DB. I made all the required changes. Its showing required output on console but not in database.!! Could you please solve my this query…?? I will truly appreciate your help…!! Thanks in advance…!!
- Rahul Gupta