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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
<%@ page import = "java.util.Date,java.util.Locale,java.text.SimpleDateFormat,java.text.DateFormat,java.text.ParseException,java.io.*,java.sql.*"
contentType="text/html; charset=utf-8" %>
<html>
<head>
<title>test</title>
</head>
<body>
<%
Class.forName("oracle.jdbc.driver.OracleDriver" );
String URL = "jdbc:oracle:thin:@xxxx";
Connection con = DriverManager.getConnection(URL,"xxxx","xxx" );
Statement stmt = con.createStatement();
ResultSet req = stmt.executeQuery("select to_char(date_appel,'dd mon yy'),nombre_rejet,duree_rejet,round(pr_nbr)||'%',round(pr_duree)||'%' from tab1 where code= 'MO'" );
out.println("<table border='1'>");
out.println("<tr>");
out.println("<th>" +"Date_appel"+ "</th>");
out.println("<th>" +"Nbre_Rejet"+ "</th>");
out.println("<th>" +"Duree_rejet"+ "</th>");
out.println("<th>" +"Pr_Nbre_rejet"+ "</th>");
out.println("<th>" +"Pr_Duree_rejet"+ "</th>");
out.println("</tr>");
out.println("<tr>");
String d_appel= null ;
while (req.next ()){
d_appel= req.getString(1) ;
out.println("<td> <a href =\"te.jsp\"> "+d_appel+" </a> </td>");
out.println("<td>" + req.getString (2) + "</td>");
out.println("<td>" + req.getString (3) + "</td>");
out.println("<td>" + req.getString (4) + "</td>");
out.println("<td>" + req.getString (5) + "</td>");
out.println("</tr>");
}
out.println("</table>");
%>
</body>
</html> |
Partager