jdni Á¢¼Ó Å×½ºÆ®(JSP)
ÀÛ¼ºÀÚ °ü¸®ÀÚ ÀÛ¼º½Ã°£ 2004-06-02 13:20:27
 

<%@ 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();
  %>


¸ñ·Ï | ÀÔ·Â | ¼öÁ¤ | ´äº¯ | »èÁ¦