Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Service
- public class ExecutionPlanService {
- List<String> l = new ArrayList<>();
- public List<String> getExecPlan(String line) throws IOException, SQLException, ClassNotFoundException{
- ResultSet rs=null;
- Class.forName("oracle.jdbc.driver.OracleDriver");
- Connection con=DriverManager.getConnection("jdbc:oracle:thin:@abc:XYZ","username","pw");
- Statement stmt = con.createStatement();
- stmt.execute(line);
- rs = stmt.executeQuery("select plan_table_output from table(dbms_xplan.display())");
- while (rs.next())
- {
- l.add(rs.getString(1));
- }
- return l;
- }
Add Comment
Please, Sign In to add comment