JNB
rss

skin by 이글루스

JEUS

jeus, 오라클 연결테스트 09.05.21 13:56

<%@ page language="java" session="true" contentType="text/html;" %>
<%@ page import="javax.naming.*, java.sql.*, javax.sql.* " %>
<html>
<head>
    <title>JEUS Test Web</title>
</head>
<body bgcolor="white" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0">
    <table cellspacing="3" cellpadding="0" border="0">
    <tr>
        <td>
        <%
            DataSource ds = null;
            Connection con = null;

            try {
                InitialContext ic = new InitialContext();
                ds = (DataSource)ic.lookup("ORADEV");
                con = ds.getConnection();
                if(con==null){
        %>
            Get Connection Fail (DBSource)
        <% }else{ %>
            Connection Object : <font color="blue"><b><%=con%></b></font>
        <%
                }
            }catch (Exception ex) {
                ex.printStackTrace();
            }finally {
                try{if(con!=null)con.close();}catch(Exception e){}
            }
        %>
        </td>
    </tr>
    </table>
</body>
</html>


        

    
Copyright 1999-2018 Zeroboard / skin by JY