JSP Java

<%@ page import="java.sql.*" %>
<% Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") ; %>

    
        Accessing the tableName Database Table
    
    
        

Accessing the tableName Database Table


        <% 
            Connection connection = DriverManager.getConnection(
                "jdbc:odbc:data", "userName", "password");
                Statement statement = connection.createStatement() ;
                ResultSet resultset = 
                    statement.executeQuery("select name from tableName") ; 
        %>
        
            
                Name
            
            <% while(resultset.next()){ %>
                
                     
                        <%= resultset.getString(1)%>  
                    
                
            <% } %>