<%@ page import="java.sql.*" %>
<% Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); %>
Selecting tableName From a Database
Selecting tableName From a Database
<%
Connection connection = DriverManager.getConnection(
"jdbc:odbc:clients", "userName", "password");
Statement statement = connection.createStatement() ;
ResultSet resultset =
statement.executeQuery("select * from achat where ville = 'paris'") ;
%>
ID |
Nom |
Ville |
Montant |
solde |
<% while(resultset.next()){ %>
<%= resultset.getString(1) %> |
<%= resultset.getString(2) %> |
<%= resultset.getString(3) %> |
<%= resultset.getString(4) %> |
<%= resultset.getString(5) %> |
<% } %>