
import java.awt.*;
import java.awt.geom.Ellipse2D;
import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Locale;
import java.text.NumberFormat;
import javax.servlet.http.HttpSession;
import org.jfree.data.*;
import org.jfree.chart.*;
import org.jfree.chart.axis.*;
import org.jfree.chart.renderer.BarRenderer;
import org.jfree.chart.renderer.StandardXYItemRenderer;
import org.jfree.chart.renderer.StackedXYAreaRenderer;
import org.jfree.chart.renderer.XYAreaRenderer;
import org.jfree.chart.plot.*;
import org.jfree.chart.entity.*;
import org.jfree.chart.labels.*;
import org.jfree.chart.urls.*;
import org.jfree.chart.servlet.*;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class ConsultaBase {
    public static connection makeConnection() {
        Connection connection;
        try {
            Class.forName("org.postgresql.Driver").newInstance();
            connection = DriverManager.getConnection(url, user, password);
        } catch (Exception e) {
            System.out.println("Error: " + e.getMessage());
        }
    }

    public static java.util.ArrayList consultar (String cons) {
        java.util.ArrayList retorno = new ArrayList();
	try {
	    Connection con = makeConnection();
            Statement stmt = connection.createStatement();
	    rs = stmt.executeQuery(cons);
	    while (rs.next()){
	      
	    }
	} catch (NoDataException e) {
		System.out.println(e.toString());
	} catch (Exception e) {
		System.out.println("Exception - " + e.toString());
		e.printStackTrace(System.out);
	}
	return retorno;
    }
}