Spring JPA 를 사용하는 이유
seonman.kim
서론 Spring Boot 를 사용하면 대부분 Spring JPA 를 이용하여 데이터베이스를 접근한다. 왜 마이바티스나 Spring JDBC 를 사용하지 않고 JPA를 사용하는 것일까? 기존 코드의 문제점 try(Connection connection = DriverManager.getConnection(url, username, password)) { System.out.println("Connection created: " + connection); String sql = "INSERT INTO ACCOUNT VALUES(1, 'keesun', 'pass');"; try(PreparedStatement statement = connection.prepareStatement(sql)) { stateme..