Returning a value from a void method in Java
<p>I have a method :</p>

<pre><code>public void dbQuery(String query, String what) {
    try {
        Statement stmt = conn.createStatement();
        ResultSet rs = stmt.executeQuery(query);

        if(what.equals("temp_table")) {
            String temporary_table = rs.getString("table_name_temp");
            System.out.println(temporary_table);
            return;
        }

        }

    catch (Exception e) {
        e.printStackTrace();
        }

    finally {
        if (rs != null) rs.close();
        if (stmt != null) stmt.close();
        }

}



String query = "EXEC temptables.dbo.create_temp_cdr 'SIP'";
String temporary_table = db.dbQuery(query,"temp_table");
</code></pre>

<p>How do I get the return of a <code>void</code> to use it in another <code>db.dbQuery()</code> ?</p>

<p>PS : I need a value from <code>dbQuery()</code> so I can construct another <code>query</code> to call <code>dbQuery()</code> again</p>
