<%@ page import="java.sql.*" %>
<% Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); %>
Using Table Metadata
Using Table Metadata
<%
Connection connection = DriverManager.getConnection(
"jdbc:odbc:data", "userName", "password");
Statement statement = connection.createStatement() ;
ResultSet resultset =
statement.executeQuery("select * from tableName") ;
%>
<%= resultset.getMetaData().getColumnName(1)%>
<%= resultset.getMetaData().getColumnName(2)%>
<%= resultset.getMetaData().getColumnName(3)%>
<%= resultset.getMetaData().getColumnName(4)%>
<%= resultset.getMetaData().getColumnName(5)%>
<% while(resultset.next()){ %>
<%= resultset.getString(1) %>
<%= resultset.getString(2) %>
<%= resultset.getString(3) %>
<%= resultset.getString(4) %>
<%= resultset.getString(5) %>
<% } %>