public Object[][] select(String table, String fields, String where){
        int registros =0;
        String Colname[] = fields.split((","));
        //Consultas SQL
        String q0= "SELECT"+fields+"FROM"+table;
        String q1= "SELECT count(*) as total FROM"+table;
        if (where!=null) {
            q0+="WHERE"+where;
            q1+="WHERE"+where;
        }
        try {   
            PreparedStatement pstm = conn.prepareStatement(q1);
            ResultSet res = pstm.executeQuery();
            res.next();
            registros = res.getInt("total");
            res.close();           
        } catch (SQLException e) {
            System.out.println(e);
        }
        
        //se crea uan matriz con tantas filas como yo necesite 
        
        
        Object data[][] = new String[registros][fields.split(",").length];
               
        try {
            PreparedStatement pstm;
            pstm = conn.prepareStatement(q0);
            ResultSet res = pstm.executeQuery();
            int i = 0;
            while (res.next()) {            
                for (int j = 0; j < fields.split(",").length-1; j++) {
                    data[i][j] = res.getString(Colname[j].trim());
                }
                i++;
                res.close();
            }            
        } catch (SQLException e) {
            System.out.println(e);
        }
        return  data;        
    }