org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [Select id from moviefinderuser where email = ?]; SQL state [S0022]; error code [0]; Column 'name' not found.; nested exception is java.sql.SQLException: Column 'name' not found. org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1542) org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:667) org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:713) org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:744) org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:757)``` ```package com.moviefindercontrollers.model; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.EmptyResultDataAccessException; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Repository; @Repository public class MovieFinderUserImp implements Dao { @Autowired private JdbcTemplate jdbcTemplate; private MovieFinderUser finderUser; public MovieFinderUserImp() { this.finderUser = new MovieFinderUser(); } @Override public int saveUser(MovieFinderUser finderUser) { String query = "INSERT INTO moviefinderuser (name, email, passoword , favouriteMovie , favouriteGenre , image) VALUES (?, ?, ? , ?, ? , ?)"; int updatedLine = jdbcTemplate.update(query,finderUser.getName() , finderUser.getEmail(), finderUser.getPassword() , finderUser.getFavouriteMovie() , finderUser.getFavouriteGenre() , finderUser.getImage()); System.out.println("It Passed THe Repo layer"); return updatedLine; } @Override public MovieFinderUser findByEmail(String email) { String query = "SELECT * FROM moviefinderuser WHERE email = ?"; try { return jdbcTemplate.queryForObject(query, new RowMapperObj(), email); } catch (EmptyResultDataAccessException e) { return null; // Return null if no user is found } } @Override public int updateUser(Long id) { finderUser = new MovieFinderUser(); String query = "Update moviefinderuser Set name = ? , favouriteMovie = ? , favouriteGenre = ? , image = ? WHERE id = ?"; Object [] data = {finderUser.getName() , finderUser.getFavouriteMovie() , finderUser.getFavouriteGenre() , finderUser.getImage() , finderUser.getEmail()}; int updatedLine = jdbcTemplate.update(query, data); return updatedLine; } @Override public int deleteUser(MovieFinderUser finderUser) { // TODO Auto-generated method stub return 0; } @Override public MovieFinderUser userID(String email) { String query = "Select id from moviefinderuser where email = ?"; MovieFinderUser finderUser = jdbcTemplate.queryForObject(query, new RowMapperObj() , email); return finderUser; } } @GetMapping("/profile") public String profile(HttpSession session, Model model) { if (session.getAttribute("isLoggedIn") == null) { return "redirect:/login"; } String email = (String) session.getAttribute("email"); MovieFinderUser id = finderService.getUserId(email); MovieFinderUser userInfo = finderUserImp.findByEmail(email); String image = (String) session.getAttribute("image"); userInfo.setId(id.getId()); session.setAttribute("image", image); session.setAttribute("userInfo", userInfo); session.setAttribute("id", id); model.addAttribute(userInfo); model.addAttribute("image", image); return "profile"; } /// Updating Profile @GetMapping("/updateProfilePage/{id}") public String updatePage(@PathVariable("id") Long id , Model model) { finderService.modifyUser(id); model.addAttribute("finderUserPojo" , new MovieFinderUserPojo()); return "updateUser"; } @PostMapping("/updateProfile") public String profileUpdate(@ModelAttribute("finderUserPojo") MovieFinderUserPojo finderUserPojo , Model model , HttpSession session) { return "updateUser"; } } package com.moviefindercontrollers.model; import java.util.Arrays; public class MovieFinderUser { private Long id; private String name; private String email; private String password; private String favouriteMovie; // Changed from favoriteMovie private String favouriteGenre; // Changed from favoriteGenre private byte[] image; public MovieFinderUser() { } public MovieFinderUser( String name, String email, String password, String favouriteMovie, String favouriteGenre , byte[] image) { this.name = name; this.email = email; this.password = password; this.favouriteMovie = favouriteMovie; this.favouriteGenre = favouriteGenre; this.image = image; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public byte[] getImage() { return image; } public void setImage(byte[] image) { this.image = image; } 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; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getFavouriteMovie() { // Changed from getFavoriteMovie return favouriteMovie; } public void setFavouriteMovie(String favouriteMovie) { // Changed from setFavoriteMovie this.favouriteMovie = favouriteMovie; } public String getFavouriteGenre() { // Changed from getFavoriteGenre return favouriteGenre; } public void setFavouriteGenre(String favouriteGenre) { // Changed from setFavoriteGenre this.favouriteGenre = favouriteGenre; } }