Package dao.tro

Examples of dao.tro.Country


            statement.setLong(1, id);
            resultSet = statement.executeQuery();
            while(resultSet.next()) {
                airport.setId(id);
                airport.setGatesNumber(resultSet.getInt("GatesNumber"));
                Country country = new Country();
                country.setId(countryId);
                country.setName(countryName);
                airport.setInCountry(country);
                airport.setName(resultSet.getString("Name"));
            }
        } catch(SQLException e) {
            Logs.info("Ошибка выборки " + e);
View Full Code Here


        try {
            PreparedStatement statement = connection.prepareStatement(query);
            statement.setLong(1, airport.getId());
            ResultSet resultSet = statement.executeQuery();
            resultSet.next();
            Country country = new Country();
            country.setName(resultSet.getString("Name"));
            airport.setInCountry(country);
        } catch (SQLException e) {
            Logs.info("Ошибка подгрузки имени страны " + e);
        }
        return airport;
View Full Code Here

             while((resultSet.next())&&(listIterator<airportCount)) {
                 airportList.add(new Airport());
                 airportList.get(listIterator).setName(resultSet.getString("Name"));
                 airportList.get(listIterator).setId(resultSet.getLong("Id"));
                 airportList.get(listIterator).setGatesNumber(resultSet.getInt("GatesNumber"));
                 airportList.get(listIterator).setInCountry(new Country());
                 airportList.get(listIterator).getInCountry().setName(resultSet.getString("CName"));
                 listIterator++;
             }
        } catch (SQLException e) {
             Logs.info("Ошибка загрузки списка аэропортов (полный список)");
View Full Code Here

    }
    public void delete (long id) {
        super.delete(id);
    }
    public Country showInformation(long id) {
        Country country = new Country();
        try {
            String showStatement = "SELECT * FROM Countries WHERE id = ?";
            PreparedStatement statement = connection.prepareStatement(showStatement);
            statement.setLong(1, id);
            ResultSet resultSet = statement.executeQuery();
            while(resultSet.next()) {
                country.setId(id);
                country.setCapital(resultSet.getString("Capital"));
                country.setLanguage(resultSet.getString("Language"));
                country.setName(resultSet.getString("Name"));
            }
        } catch(SQLException e) {
            Logs.info("Ошибка выборки " + e);
        }
        return country;
View Full Code Here

            String query = "SELECT Name FROM Countries";
            PreparedStatement statement = connection.prepareStatement(query);
            ResultSet resultSet = statement.executeQuery();
            int listIterator = 0;
            while (resultSet.next()) {
                countryList.add(new Country());
                countryList.get(listIterator).setName(resultSet.getString("Name"));
                listIterator++;
            }
        } catch (SQLException e) {
            Logs.info("Ошибка загрузки списка стран");
View Full Code Here

            String query = "SELECT * FROM Countries";
            PreparedStatement statement = connection.prepareStatement(query);
            ResultSet resultSet = statement.executeQuery();
            int listIterator = 0;
            while ((resultSet.next())&&(listIterator<countryCount)) {
                countryList.add(new Country());
                countryList.get(listIterator).setId(resultSet.getLong("Id"));
                countryList.get(listIterator).setName(resultSet.getString("Name"));
                countryList.get(listIterator).setCapital(resultSet.getString("Capital"));
                countryList.get(listIterator).setLanguage(resultSet.getString("Language"));
                listIterator++;
View Full Code Here

TOP

Related Classes of dao.tro.Country

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.