<% Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); %>
Selecting tableName From a Database
<%
Connection connection = DriverManager.getConnection(
"jdbc:odbc:data", "userName", "password");
Statement statement = connection.createStatement() ;
ResultSet resultset =
statement.executeQuery("select * from tableName where city = 'Boston'") ;
%>
| ID | Name | City | State | Country |
|---|---|---|---|---|
| <%= resultset.getString(1) %> | <%= resultset.getString(2) %> | <%= resultset.getString(3) %> | <%= resultset.getString(4) %> | <%= resultset.getString(5) %> |


No comments:
Post a Comment