import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.lang.Object.*;
import java.sql.*;

public class Andmed extends HttpServlet{
	Connection cn;
	
	public Andmed(){
		try{
			
		}catch(Exception e){
			System.out.println("v1:"+e);
		}		
	}	
	//*****************************************//
	public void doGet(HttpServletRequest kysimus, HttpServletResponse vastus) throws IOException, ServletException{	
		PrintWriter pw=vastus.getWriter();
		try{			
			vastus.setContentType("text/plain");			
			String lause;
			ResultSet rs;
			Statement st;
			
				
					Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");			
					cn=DriverManager.getConnection("jdbc:odbc:andmed", "", "");			
					st=cn.createStatement();
					
					lause="SELECT * FROM skoorid ORDER BY punktid desc";
					rs=st.executeQuery(lause);					
					
					while(rs.next()){
						pw.println(rs.getString("nimed")+" "+rs.getString("punktid"));
					}			
					cn.close();
				
			
		}catch(Exception e){
			//pw.println("");
		}
	}
}