Package mymadrid.dao

Examples of mymadrid.dao.PlayerDao


public class Manage {
   
   
    public static void main(String[] args) throws SQLException, IOException {
    Vector<Player> listPlayers ;
    PlayerDao pdao = new PlayerDao();
    Player cassilas = new Player("Iker", "Casillas Fernandez", new Date(81, 05, 20, "Mostoles, Spain", "Goalkeeper", "182.2 cm", "85.5 kg", "Spanish", "I am a winner whose work is based on humiliy", 1 ,"./images/casillas.jpg");
   
   
    Player ALONSO = new Player("XABI", "Alonso Olano", new Date(81, 11, 25, "Tolosa, Spain", "Midfielder", "182.7 cm", "79 kg", "Spanish", "I am simply a team player", 14 ,"./images/alonso.jpg");
    Player OZIL = new Player("Mesut", "OZIL", new Date(88, 10, 15, "Gelsenkirchen, Germany", "Midfielder", "181 cm", "70 kg", "German", "I will do my best to win titles with Real Madrid", 10 ,"./images/ozil.jpg");
    Player PEPE = new Player("PEPE", "Kléper Laverán", new Date(86, 02, 26, "Maceió, Brazil", "Defender", "187.1 cm", "81 kg", "Portuguese/Brazilian", "I have character and I am devoted to this club and to my team-mates", 3 ,"./images/pepe.jpg");
    Player ronaldo = new Player("CRISTIANO RONALDO", "dos Santos Aveiro", new Date(85, 02, 05, "Madeira, Portugal", "Forward", "186.5 cm", "84.5 kg", "Portuguese", "I am an ambitious player with only one objective: victory fo my team", 7 ,"./images/ronaldo.jpg");
   
    Player Kaka = new Player("KAKA", "Ricardo Izecson Dos Santos", new Date(82, 04, 22, "Brasilia, Brazil", "Midfielder", "185.6 cm", "82 kg", "Brazilian", "I dream about a great play every day of my life", 8 ,"./images/kaka.jpg");
   
    Player Benzima = new Player("BENZEMA", "Karim", new Date(87, 12, 19, "Lyon, France", "Forward", "184.1 cm", "83.5 kg", "French", "I am a striker who loves good football", 9 ,"./images/benzima.jpg");
   
     pdao.InsertPlayer(Kaka);
    pdao.InsertPlayer(Benzima);
   
//    pdao.InsertPlayer(ALONSO);
//    pdao.InsertPlayer(OZIL);
//    pdao.InsertPlayer(PEPE);
//    pdao.InsertPlayer(ronaldo);
View Full Code Here


   
       
    }

    public static void extractPlayersImages() throws SQLException, FileNotFoundException, IOException {
       PlayerDao pdao = new PlayerDao();
      
        for (Player p : pdao.SelectPlaeyrs()) {
                        System.out.println(p.getImage());
                        InputStream is = p.getImage() ;
                        //File file = new File
                        FileOutputStream fos = new FileOutputStream(".\\imageFromDB\\"+p.getNom() +".jpg");
                        int b = 0
View Full Code Here

    /**
     * Creates new form AllMatches
     */
    public PlayersInfo(final MainPanel mainPanel) throws SQLException, FileNotFoundException, IOException {
        initComponents();
        PlayerDao pdao = new PlayerDao();
         Vector<Player > playerVector = new Vector<Player >();
         playerVector = pdao.SelectPlaeyrs();
         //Random random = new Random(playerVector.size());
//        
//        for (Player p : pdao.SelectPlaeyrs()) {
//                        System.out.println(p.getImage());
//                        InputStream is = p.getImage() ;
//                        //File file = new File
//                        FileOutputStream fos = new FileOutputStream(".\\imageFromDB\\tt.jpg");
//                        int b = 0; 
//                        while ((b = is.read()) != -1) 
//                        { 
//                            fos.write(b); // fos is the instance of FileOutputStream 
//                        } 
//           
//           ImageIcon icon = new ImageIcon(".\\imageFromDB\\tt.jpg");
//  
//        playerImage.setIcon(icon); 
//          
//                    }
       
        Timer timer = new Timer();
         timer.schedule( new TimerTask() {
             public void run() {
                 //playerImage.setIcon(null);
                 PlayerDao pdao = new PlayerDao();
         Vector<Player > playerVector = new Vector<Player >();
                try {
                    playerVector = pdao.SelectPlaeyrs();
                } catch (SQLException ex) {
                    Logger.getLogger(PlayersInfo.class.getName()).log(Level.SEVERE, null, ex);
                }
                
                int playernumber = random.nextInt(playerVector.size());
View Full Code Here

TOP

Related Classes of mymadrid.dao.PlayerDao

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.