Created
December 12, 2016 08:44
-
-
Save devheedoo/6c73ef370bb461dded4474fe9844c6a7 to your computer and use it in GitHub Desktop.
Test oracle connection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ page contentType="text/html; charset=EUC-KR" %> | |
<%@ page import="java.sql.*" %> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR" /> | |
<title>Oracle Connection Test</title> | |
</head> | |
<body> | |
<h1>Oracle Connection Text</h1> | |
<% | |
String res = ""; | |
try { | |
Class.forName("oracle.jdbc.driver.OracleDriver"); | |
String url = "jdbc:oracle:thin:@ipAddress:1521:serviceName"; | |
Connection conn = DriverManager.getConnection(url, "id", "pw"); | |
if (conn != null) { | |
res = "Connection success!"; | |
} | |
} catch (Exception e) { | |
res = "Connection fail: " + e; | |
} | |
%> | |
<p><%=res %></p> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment