---------------------------------------------------page de connection--------------------------------------------------
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.sql.*" %>
<%
Connection con=null;
Statement stmt = null;
ResultSet rs=null;
boolean testcon=true;
try{
try{
Class.forName("votre driver oracle");//sun.jdbc.odbc.JdbcOdbcDriver
con=DriverManager.getConnection("jdbc:oracl://127.0.0.1/BaseDonne","user","pass");
}catch(ClassNotFoundException e){}
stmt = con.createStatement();
}catch(Exception e){
testcon=false;
}
%>
-------------------------------------------- page d'affchiage de resultat------------------------------------------------
<div>
<blockquote>
<%
try{
int i=1,j=0,t,f;
rs=stmt.executeQuery("Select * from votreTable");
while(rs.next())j++;
rs=stmt.executeQuery("select 1er_champ,2eme_champ,3eme_champ,4eme_champ from votreTable limit "+f+",5 ");
while(rs.next()){ String 1er_champ=rs.getString(1); String 2er_champ=rs.getString(2);%>
<tr>
<td style="width:6cm; cursor:pointer;"><%= 1er_champ %><td>
<td style="width:4cm;"><%= rs.getString(2)%></td>
<td style="width:4cm;"><%= rs.getString(3)%></td>
<td style="width:4cm;"><%= rs.getString(4)%></td>
</tr>
<%
i++;
}
%></form></table><%
}catch(Exception exp){
out.print(exp.toString());
}
%>
</blockquote>
</div>
Partager