weblogic 인스턴스명이 출력되도록 커스터마이징 하였음
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="javax.naming.*, javax.sql.*, java.sql.*" %>
<%@ page import="java.util.Properties"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>WebLogic 12.2.1.3 JDBC</title>
</head>
<body>
<h3>
ServerName :
<%
String instName=System.getProperty("weblogic.Name");
%>
<%=instName%>
</h3>
<center>
<h1>GTPLUS People</h1>
<table border="3" bordercolor="cornflowerblue">
<tr bgcolor="cornflowerblue"><td>name<td>gender<td>age</tr>
<%
Context ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup("test");
Connection conn = ds.getConnection();
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT name, gender, age FROM people");
Thread.sleep(1000);
while(rs.next()){
out.println("<tr>");
out.println("<td>"+rs.getString("name"));
out.println("<td>"+rs.getString("gender"));
out.println("<td>"+rs.getString("age"));
out.println("</tr>");
}
rs.close();
stmt.close();
conn.close();
%>
</table>
</center>
</body>
</html>
'WAS - WebLogic > 각종 설정, 에러 조치' 카테고리의 다른 글
[Deploy 관련] - WLS 마라톤 사용 방법 (0) | 2021.08.17 |
---|---|
[weblogic] 어플리케이션 deploy - weblogic.xml 예시 (0) | 2021.08.17 |
[weblogic] 어플리케이션 deploy 테스트 - FailoverTest.jsp 예시 (0) | 2021.08.17 |
weblogic 데이터소스 생성 (Oracle DB) (0) | 2021.08.17 |
WebLogic - 데이터소스 관련 각종 로그 (Connection Pool Max 등) (0) | 2021.08.17 |