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
- Windows
- Eclipse
- maVen
- profile
- import
- plugin
- Source
- netsh
- IntelliJ
- xargs
- find
- JavaScript
- tomcat
- port
- Mac
- context
- vscode
- 줄바꿈 문자
- resource
- 단축키
- GIT
- lsof
- Windows 10
- bash
- VirtualBox
- ssh
- web.xml
- grep
- Quartz
- 네트워크
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