Package banco_imobiliario.model

Examples of banco_imobiliario.model.Noticia


    public ArrayList<Noticia> getAllCartas() {
   
        int id;
        double valor;
        String titulo, texto;
        Noticia carta;
        ArrayList<Noticia> cartas = new ArrayList<Noticia>();
       
        String sqlQuery = "SELECT id, titulo, texto, valor FROM carta";


        try {

            conexaoBanco = DAOConection.getConnection();
            preparedStatement = conexaoBanco.prepareStatement(sqlQuery);

            resultadoConsulta = preparedStatement.executeQuery();

            while(resultadoConsulta.next()){

                carta = new Noticia();

                id = Integer.valueOf(resultadoConsulta.getString("id"));
                titulo = resultadoConsulta.getString("titulo");
                texto = resultadoConsulta.getString("texto");
                valor = Double.valueOf(resultadoConsulta.getString("valor"));

                carta.setId(id);
                carta.setTitulo(titulo);
                carta.setTexto(texto);
                carta.setValor(valor);

                cartas.add(carta);

            }
View Full Code Here

TOP

Related Classes of banco_imobiliario.model.Noticia

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.