ORACLE 정보는
db:TESTDB
ip:10.134.217.132
port:3001
username=test
tomcat was 의 server.xml입니다
<Resource JtaManaged="false" auth="Container" driverClassName="oracle.jdbc.OracleDriver" initialSize="10" maxActive="100" maxIdle="100" maxWait="30000" minIdle="10" name="jdbc/oracle" password="sDigiC+Q3ctNGw+xs+Yvxw==" passwordEncrypted="true" removeAbandonedTimeout="60" type="javax.sql.DataSource" url="jdbc:oracle:thin:@10.134.217.132:3001:TESTDB" username="test"/>
context.xml입니다
<ResourceLink global="jdbc/oracle" name="jdbc/oracle" type="javax.sql.DataSource"/>
이렇게 설정해준 뒤
dbtest.jsp
<%@ page language="java" contentType="text/html; charset=EUC-KR"
pageEncoding="EUC-KR"%>
<%@ page import="javax.naming.*, javax.sql.*, java.sql.*"%>
<%@ page language="java" contentType="text/html; charset=EUC-KR" %>
<%
Connection con = null;
PreparedStatement stmt = null;
Context initCtx = new InitialContext();
Context envCtx = (Context)initCtx.lookup("java:comp/env");
DataSource ds = (DataSource)envCtx.lookup("jdbc/oracle");
con = ds.getConnection();
String msg = "disconnection";
if(con != null)
{
msg = "connection";
}
%>
<html>
<head>
<title>DB Test</title>
</head>
<body>
<h2>Results = <%=msg %></h2>
</body>
</html>
org.apache.jasper.JasperException: An exception occurred processing JSP page /dbtest.jsp at line 11 8: 9: Context initCtx = new InitialContext(); 10: Context envCtx = (Context)initCtx.lookup("java:comp/env"); 11: DataSource ds = (DataSource)envCtx.lookup("jdbc/oracle"); 12: 13: con = ds.getConnection(); 14: String msg = "disconnection";
500 에러가 뜨는데 무엇이 문제일까요?
dbtest.jsp 코드가 문제일까요?
아니면 구성정보가 문제일까요?