I have a method :
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");
How do I get the return of a void
to use it in another db.dbQuery()
?
PS : I need a value from dbQuery()
so I can construct another query
to call dbQuery()
again