|
<%@ page import="java.sql.*, javax.naming.*, javax.sql.*"%>
<%
Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup("java:comp/env");
DataSource ds = (DataSource) envCtx.lookup("jdbc/soriDB");
Connection conn = ds.getConnection();
Statement stmt = conn.createStatement();
String query = "select sysdate from dual";
ResultSet rs = stmt.executeQuery(query);
if(rs.next())
{ out.println(rs.getTimestamp(1));}
rs.close();
stmt.close();
conn.close();
%>
|