package UI;

import java.math.BigDecimal;
import java.sql.Connection;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.Statement;
import java.sql.SQLException;
import java.sql.Time;
import java.sql.Timestamp;
import javax.sql.DataSource;
import org.postgresql.ds.PGSimpleDataSource;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Calendar;
import RDG.*;

/**
 *
 * @author Marcel
 */
public class TrasportedPeople {
    
    /**
    * Print difference in number of transported people by company and year,
    * @throws SQLException
    */
    static public void printStats() throws SQLException{
        var rs=RDG.TransportedPeopleDB.getStats();
        System.out.println("Meno \t\t\t rok \t pocet \t rozdiel");
        for(var r:rs){
            System.out.println(r.get(0)+" \t "+r.get(1)+" \t "+r.get(2)+" \t "+r.get(3));
        }
    }
    /**
    * Menu. Calls printStats function.
    */
    
    static public void Menu(){
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        Timestamp from;
        try{
            System.out.println("Ok, zistiť rozdiely prepravených osôb.");
            printStats();
        }catch(Exception e){
            System.out.println(e);
            return;
        }
        
    }
}
