NamedParameterJdbcTemplate (1) 썸네일형 리스트형 2-1) 스프링 JDBC: DataSource, H2, SimpleJdbcInsert, NamedParameterJdbcTemplate, BeanPropertyRowMapper, BeanPropertySqlParameterSource - JAVA에서의 DB 접근: JDBC 거의 모든 서비스는 데이터를 기반으로 이루어진다. 따라서 DB에 접근하는 동작이 자주 수행되는데, JAVA에서는 이를 위해 JDBC가 존재한다. JDBC는 JAVA에서 각 데이터베이스에 접근하기위한 인터페이스이다. 실제 코드를 보면 다음과 같이 DB에 접근하여 데이터를 가져올 수 있다. Connection conn = null; PreparedStatement stmt = null; ResultSet rs = null; try { // 1. Connection을 가져오고 conn = dataSource.getConnection(); // 2. 쿼리를 실행할 준비를하고 stmt = conn.prepareStatement("SELECT * FROM Noun001"); .. 이전 1 다음