Embed this query via Statement object and execute this statement object via statement.executeQuery() and finally store the resultant in ResultSet Object
String query="select *
from sysobjects
where type ="+"'"+TR+"'";
stmt = con.createStatement();
ResultSet rs =
stmt.executeQuery(query);