250x250
Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
Tags
- myBatis
- ubuntu
- Eclipse
- SpringBoot
- Tomcat
- oracle
- spring
- JavaScript
- Thymeleaf
- AJAX
- Spring Boot
- MSSQL
- 문서
- maven
- Open Source
- IntelliJ
- Python
- Core Java
- error
- 오픈소스
- MySQL
- Source
- Exception
- 설정
- STS
- Docker
- jpa
- JDBC
- PostgreSQL
- git
Archives
- Today
- Total
헤르메스 LIFE
[Source] JDBC Connection Test && JDBC Version 확인 본문
728x90
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" import="java.sql.*"%>
<!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=UTF-8" >
<title>DB Connection Test</title>
</head>
<body>
<%
String DB_URL = "jdbc:oracle:thin:@localhost:1524:SDI";
String DB_USER = "유저ID";
String DB_PASSWORD= "패스워드";
Connection conn;
Statement stmt;
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
conn = DriverManager.getConnection(DB_URL, DB_USER, DB_PASSWORD);
DatabaseMetaData dbmd = conn.getMetaData();
out.println("=== Database Info ====</br>");
out.println("dbmd.getDatabaseProductName() :: " + dbmd.getDatabaseProductName() + "</br>" );
out.println("dbmd.getDatabaseProductVersion() :: " + dbmd.getDatabaseProductVersion() + "</br>" );
out.println("dbmd.getDatabaseMajorVersion() :: " + dbmd.getDatabaseMajorVersion() + "</br>" );
out.println("dbmd.getDatabaseMinorVersion() :: " + dbmd.getDatabaseMinorVersion() + "</br>" );
out.println("</br></br></br></br></br>");
out.println("=== JDBC Info ====</br>");
out.println("dbmd.getDriverName() :: " + dbmd.getDriverName() + "</br>");
out.println("dbmd.getDriverVersion() :: " + dbmd.getDriverVersion() + "</br>");
out.println("dbmd.getDriverMinorVersion() :: " + dbmd.getDriverMinorVersion() + "</br>" );
out.println("dbmd.getDriverMajorVersion() :: " + dbmd.getDriverMajorVersion() + "</br>" );
conn.close();
out.println("Oracle jdbc test: connect ok!!");
} catch(Exception e) {
out.println(e.getMessage());
}
%>
</body>
</html>
https://hermeslog.tistory.com/171?category=307167
728x90
'JSP&JavaScript&HTML' 카테고리의 다른 글
Ajax data를 Controller에서 받는 두 가지 방법 : Vo / Map (0) | 2023.06.05 |
---|---|
[Modal] Javascript, jQuery 기반의 Open Source Modal Plugin (0) | 2023.05.06 |
[jQuery] 클립보드 복사 & 붙여넣기 (0) | 2021.02.15 |
[JSON] 문자열을 JSON 변환, JSON 을 문자열 변환 (0) | 2021.01.26 |
오른쪽 마우스 금지 (0) | 2020.12.17 |