JDBC
-
JDBC 사용 - 커넥션 풀Spring/Spring 기본 지식 2020. 3. 23. 17:47
DriverManagerDataSource 사용시 문제점 설정 // jdbc 설정하는 xml 인위적인 오류 실행 - jdbc 연결을 인위적으로 많이 발생시킴 ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.postgresql.util.PSQLException: The connection attempt failed.]을(를) 발생시켰습니다. java.net.SocketTimeoutException: connect timed out at java.net.DualStackPlainSocketImpl.waitForConnect(Native..
-
Spring postgresql mybatis jdbc 기본 연결테스트Spring/Spring 기본 지식 2020. 3. 23. 10:51
기본 구조 Junit5 사용하여 연결 테스트 @ContextConfiguration(locations={"file:src/main/webapp/WEB-INF/spring/PostgreSQL-context.xml"}) public class PostgreSQLConnectionTest { @Autowired private DataSource ds; @Test public void testConnection() throws Exception { try (Connection con = ds.getConnection()) { System.out.println("\nDBConnection 있냐? : " + con + "\n"); } catch (Exception e) { e.printStackTrace(); } ..