i'm working with java in eclipse.I am trying to take 2 variables from my database and write it to an excel.My only problem is returning 2 different values(an integer and a string) from db reader method and send it to excel writer method which are in different classes.
Here is my db reader class:

```
public class DbConnection {
public void createConnection(String choice) {
    try {
        String myDriver = "com.mysql.jdbc.Driver";
        String db = "jdbc:mysql://localhost/digiturkschema";
        Class.forName(myDriver);
        Connection conn = DriverManager.getConnection(db, "root",
                "*****");
        Statement st = conn.createStatement();
        switch (choice) {
        case "write":
            ResultSet rs = st.executeQuery("SELECT * FROM channelstable");
            while (rs.next()) {
                int channelId = rs.getInt("channelNo");
                String channelName = rs.getString("channelName");
            }
        }
    } catch (Exception exception) {
        System.out.print(exception.getStackTrace());
    }
}
}

```

I need to return "channelId" and "channelName" from this method to this method:

```
public class WritingToExcel {
public void Write() throws IOException {
    try {
        JFileChooser f = new JFileChooser();
        f.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        f.showSaveDialog(null);

        System.out.println(f.getCurrentDirectory());
        System.out.println(f.getSelectedFile());
        String direction = f.getSelectedFile().toString() + "\\DigiTurkKanalListesi.xls";

        WritableWorkbook workbook = Workbook.createWorkbook(new File(direction));
        WritableSheet sheet = workbook.createSheet("Kanal Listesi", 0);

        Label label = new Label(0, 0, "A label record");
        sheet.addCell(label);

        Number number = new Number(2, 1, 3.1459);
        sheet.addCell(number);

        workbook.write();
        workbook.close();
    } catch (WriteException e) {
        e.getStackTrace();
    }
}}

```

I know that writingToExcel class is not completed and it's ok,i can finish it if i can take these two variables to this class.By the way i am using MVC pattern so i have a controller class between them.I can write it too if it's necessary.