티스토리 뷰
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page contentType="text/html; charset=utf-8" %>
<%@ page import="javax.naming.*" %>
<%@ page import="javax.sql.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.net.*" %>
<%
Context ctx = null;
DataSource ds = null;
Connection conDs = null;
Statement stmt = null;
ResultSet rs = null;
try {
//localbinding lookup1
/*
Context initContext = new InitialContext();
ctx = (Context)initContext.lookup("java:comp/env");
ds = (DataSource)ctx.lookup("yerin_cloud");
*/
/*
//localbinding lookup2
Context initContext = new InitialContext();
ds = (DataSource)initContext.lookup("java:comp/env/test");
conDs = ds.getConnection();
*/
//global binding lookup - jndi서버를 통한 resource lookup임.
ctx = new InitialContext();
ds = (DataSource) ctx.lookup("myDataSource");
conDs = ds.getConnection();
stmt = conDs.createStatement();
String query = " select 'Connect Success!!!' from dual ";
out.println("query : "+query+" ");
rs = stmt.executeQuery( query );
while (rs.next()) {
out.print("result : " +rs.getString(1));
}
} catch ( Exception e ) {
e.printStackTrace();
} finally {
if ( stmt != null ) try { stmt.close(); } catch(Exception e) {}
if ( conDs != null ) try { conDs.close(); } catch(Exception e) {}
}
%>
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 2020.09
- 2020.1
- 서비스회사
- 표준프레임워크 배치
- TMK
- code vision
- 코딩
- 아두이노스토리
- shortkey
- JsonMergePatch
- 이직
- jeus8
- IntelliJ
- code mining
- Arduino
- 12FactorApp
- 아두이노
- JBR-2732
- JsonPatch
- 우테캠프로
- CONDINGARRAY
- coding
- JBR-526
- 코딩입문
- 우테캠
- 코딩어레이키트
- SI
- 표준프레임워크 배치 jar
- intellij느려짐
- CODINGARRAYKIT
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함