package UI;

import java.io.IOException;
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 RDG.*;

public class Projekt {
    
    /**
    * Connects to DB and prints main menu
    * @param args String[]
    * @throws SQLException
    * @throws Exception
    * @throws IOException
    */
    public static void main(String[] args) throws SQLException, IOException, Exception {
        PGSimpleDataSource dataSource = new PGSimpleDataSource();
        dataSource.setServerName("db.dai.fmph.uniba.sk");
		dataSource.setPortNumber(5432);
		dataSource.setDatabaseName("playground");
		dataSource.setUser("palaj6@uniba.sk");
		dataSource.setPassword("Databazy123");
	
        try (Connection connection = dataSource.getConnection()) {
            DbContext.setConnection(connection);
            System.out.println("Pripojil som sa k DB");
            
            Menu.MainMenu();
            
        }catch(Exception e){
            System.out.println(e);
        }
        
        System.out.println("Koniec");
    }

}