dcsimg
displaying data in a table on a web page
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Patrick_Geary
Posted On:   Wednesday, April 23, 2003 09:49 AM

Top Premiership Teams Hi I have retrieved data from my website but i am not happy with the way it is displayed on the webpage. I have 3 columns of data-----Position,Team,Points. I have tried my best to format the data to appear in columns but to no avail. I was hoping someone would be able to give me the code for displaying the data in a table This is the code i have at the moment:- <%@page language="java" contentType="text/html" import="java.sql.*"%> Top Premiership Teams Position         Team       Points Scored <% //load the MySQL JDBC driver Class.forName("sun.jdbc.odbc.JdbcOdbcDriv   More>>
Top Premiership Teams

Hi


I have retrieved data from my website but i am not happy with the way it is displayed on the webpage. I have 3 columns of data-----Position,Team,Points. I have tried my best to format the data to appear in columns but to no avail. I was hoping someone would be able to give me the code for displaying the data in a table
This is the code i have at the moment:-

			
<%@page language="java" contentType="text/html" import="java.sql.*"%>






Top Premiership Teams


Position         Team       Points Scored

<% //load the MySQL JDBC driver
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

//open a connection to the "fantasyfootball" database
java.sql.Connection con = java.sql.DriverManager.getConnection("jdbc:odbc:fantasyfootball","","");

//create a statement object for sending SQL queries
java.sql.Statement stmt = con.createStatement();

java.sql.ResultSet RS = stmt.executeQuery("SELECT team_name,points_scored FROM eng_prem ORDER BY points_scored DESC");
int count=1;
while(RS.next())
{


%>
<%out.println(" Number   "+count+"         " +RS.getString("team_name")+"                    " +RS.getInt("points_scored"));%>


<%
count++;

}

//clean up
RS.close();
con.close(); %>












Any help would be greatly appreciated


Thanks


Patrick

   <<Less
About | Sitemap | Contact