<%@ page language= "java" contentType ="text/html; charset=UTF-8"
pageEncoding= "UTF-8" %>
<%@ taglib prefix= "c" uri = "http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix= "sql" uri = "http://java.sun.com/jsp/jstl/sql" %>
< sql:setDataSource
url= "jdbc:oracle:thin:@127.0.0.1:1521:orcl"
driver= "oracle.jdbc.driver.OracleDriver"
user= "scott"
password= "tiger"
var= "ds1"
scope= "page"
/>
< sql:query sql= "select * from emp" var= "rs1" dataSource =" ${ds1 } " />
<! DOCTYPE html>
< html>
< head>
< meta charset= "UTF-8" >
< title> Insert title here </title >
</ head>
< body>
< table border= "1" >
< tr>
< c:forEach var= "columnName" items = "${rs1.columnNames } " >
< td> ${columnName }
</ c:forEach>
</ tr>
< c:forEach var= "i" items = "${rs1.rowsByIndex } ">
< tr>
< c:forEach var= "columnValue" items = "${i } ">
< td> ${columnValue } </td >
</ c:forEach>
</ tr>
</ c:forEach>
</ table>
</ body>
</ html>
'JAVA > JSP & Servlet' 카테고리의 다른 글
이클립스 톰캣 사용시 이미지 새로고침 문제 해결 (0) | 2015.06.22 |
---|---|
JSTL [Function 라이브러리] (0) | 2013.03.26 |
JSTL [Formatting 라이브러리] : formatNumber (0) | 2013.03.26 |
JSTL [Formatting 라이브러리] : formatData[pattern] (0) | 2013.03.26 |
JSTL [Formatting 라이브러리] : formatData (0) | 2013.03.26 |