Notice
Recent Posts
Recent Comments
Link
«   2024/07   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
Tags
more
Archives
Today
Total
관리 메뉴

WON.dev

JDBCTests.java 본문

SPRING/chapter04_MVC

JDBCTests.java

GAWON 2023. 7. 18. 09:40
package org.joonzis.persistence;

import static org.junit.Assert.fail;

import java.sql.Connection;
import java.sql.DriverManager;

import org.junit.Test;

import lombok.extern.log4j.Log4j;

@Log4j
public class JDBCTests {

	static {
		try {
			Class.forName("oracle.jdbc.driver.OracleDriver");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	@Test
	public void testConnection() {
		try(Connection con = DriverManager.getConnection(
				"jdbc:oracle:thin:@localhost:1521:xe",
				"scott",
				"tiger"
				)
			) 
		{
			log.info(con);
		} catch (Exception e) {
			fail(e.getMessage());
		}
	}
	
	
	
	
}

'SPRING > chapter04_MVC' 카테고리의 다른 글

BoardServiceTests.java  (0) 2023.07.18
MemberTests.java  (0) 2023.07.18
DataSourceTests.java  (0) 2023.07.18
ReplyMapperTests.java  (0) 2023.07.18
MemberMapperTests.java  (0) 2023.07.18