Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- IntelliJ
- bash
- VirtualBox
- Windows 10
- web.xml
- vscode
- 단축키
- 줄바꿈 문자
- Mac
- context
- Windows
- netsh
- lsof
- GIT
- plugin
- Source
- port
- maVen
- Eclipse
- ssh
- tomcat
- 네트워크
- grep
- find
- xargs
- resource
- profile
- import
- Quartz
- JavaScript
Archives
- Today
- Total
develog
jndi 본문
private static void setJndi() throws Exception {
SimpleNamingContextBuilder builder = new SimpleNamingContextBuilder();
builder.activate();
JndiTemplate jt = new JndiTemplate();
jt.bind("jdbc/myDB", getMyDataSource());
}
private static DriverManagerDataSource getMyDataSource() {
DriverManagerDataSource ds = new DriverManagerDataSource();
ds.setDriverClassName("oracle.jdbc.driver.OracleDriver");
ds.setUrl("jdbc:oracle:thin:@127.0.0.1:1521:orcl");
ds.setUsername("scott");
ds.setPassword("tiger");
return ds;
}
'Dev > Java' 카테고리의 다른 글
servlet, jsp, tomcat, java 버전별 비교 (0) | 2013.07.24 |
---|---|
REQUIRES_NEW (0) | 2013.07.18 |
template, callback (0) | 2013.07.17 |
AsyncHttpClient (0) | 2013.07.11 |
StringBuilder, replace (0) | 2013.07.11 |
Comments