Question: How can I "write" an ArrayList in a file, which I can download after the writing? One element in the list is one line in the CSV-file.

For example:
I have an `ArrayList<String> myList = service.getList`
Than I want to write in a File. in a simple client-only-application it would be easy. But I have to do it with **Apache Wicket**. Also it would be nice, to have a Filebrowser, where I can specify, in which directory I want to download it.

I thought, it would work this way:

```
final File filetoSave = new File("Exported Objects.csv");
        Writer writer = null;
        try {

            writer = new BufferedWriter(new FileWriter(filetoSave));
            writer.write("");
            for (obj o : listO) {
                writer.append(o.getasd);

            }
        } catch (IOException ex) {
            // report
        } finally {
            try {
                writer.close();
            } catch (Exception ex) {
            }
        }

```

But it won't. I have to use a **JBoss-server**. On my local jetty-served it worked, but on the JBoss-server it's not possible to do it this way.
Wicket-version: 1.4.7

Answer: 
Yes, `New Query` creates a new connection to the database. Each query window maintains an independent connection.

The connection number is the number shown in `()` brackets at both the end of the tab name and in the status bar (after the user name)

![enter image description here](https://i.stack.imgur.com/TZKYa.png)

Shown circled in red - this query window has connection number 57 to it's respective server. An `sp_who2` executed in this window will show that connection 57 is active and running `sp_who2`.
When you click on new query, it will open an editor on which you can try writing your queries.

When you click on new query, you need to make sure that appropriate database has been selected. By default, it will be pointing to Temp.

A new connection will not be opened rather it points to one of the data bases on the server

Hope it helps..