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
|
<%@ page language="java" contentType="text/html; charset=EUC-KR"
pageEncoding="EUC-KR"%>
<%
Connection conn = null; //connection 객체 생성
//
String url = "jdbc:oracle:thin:@localhost:1521:xe";
Boolean connect = false;
try{
//jdbc드라이버 이름으로 로드한다
conn = DriverManager.getConnection(url, "scott","tiger");
connect =true;
}catch(Exception e ){
connect = false;
e.printStackTrace();
}
%>
<h3>
<%if(connect ==true) {%>
연결
<%}else{ %>
실패
<%} %>
</h3>
Colored by Color Scripter
|
'IT > JSP' 카테고리의 다른 글
[JSP] 컨넥션 풀을 이용한 페이지 제어 연습 01 (1) | 2019.05.15 |
---|---|
[JSP]회원가입 페이지 제어 (0) | 2019.05.15 |
[JSP]context.xml (0) | 2019.05.15 |
[JSP]커넥션 풀(Connection Pool) (0) | 2019.05.15 |
[JSP]자바빈 02 (0) | 2019.05.14 |