@Test public void testExplainPlanFor() throws SQLException, NamingException { DatabaseInformations.explainPlanFor("select 1"); }
public static String explainPlanFor(String sqlRequest) throws SQLException, NamingException { final Connection connection = getConnection(); if (connection != null) { try { final Database database = Database.getDatabaseForConnection(connection); if (database == Database.ORACLE) { final String statementId = String.valueOf(sqlRequest.hashCode()); final String explainRequest = buildExplainRequest(sqlRequest, statementId); final Statement statement = connection.createStatement(); try { statement.execute(explainRequest); } finally { statement.close(); } return getPlanOutput(connection, statementId); } } finally { if (!connection.getAutoCommit()) { connection.rollback(); } connection.close(); } } return null; }
DatabaseInformations implements Serializable { public static String explainPlanFor(String sqlRequest) throws SQLException, NamingException { final Connection connection = getConnection(); if (connection != null) { try { final Database database = Database.getDatabaseForConnection(connection); if (database == Database.ORACLE) { final String statementId = String.valueOf(sqlRequest.hashCode()); final String explainRequest = buildExplainRequest(sqlRequest, statementId); final Statement statement = connection.createStatement(); try { statement.execute(explainRequest); } finally { statement.close(); } return getPlanOutput(connection, statementId); } } finally { if (!connection.getAutoCommit()) { connection.rollback(); } connection.close(); } } return null; } }
DatabaseInformations implements Serializable { public static String explainPlanFor(String sqlRequest) throws SQLException, NamingException { final Connection connection = getConnection(); if (connection != null) { try { final Database database = Database.getDatabaseForConnection(connection); if (database == Database.ORACLE) { final String statementId = String.valueOf(sqlRequest.hashCode()); final String explainRequest = buildExplainRequest(sqlRequest, statementId); final Statement statement = connection.createStatement(); try { statement.execute(explainRequest); } finally { statement.close(); } return getPlanOutput(connection, statementId); } } finally { if (!connection.getAutoCommit()) { connection.rollback(); } connection.close(); } } return null; } DatabaseInformations(int selectedRequestIndex); }
DatabaseInformations implements Serializable { public static String explainPlanFor(String sqlRequest) throws SQLException, NamingException { final Connection connection = getConnection(); if (connection != null) { try { final Database database = Database.getDatabaseForConnection(connection); if (database == Database.ORACLE) { final String statementId = String.valueOf(sqlRequest.hashCode()); final String explainRequest = buildExplainRequest(sqlRequest, statementId); final Statement statement = connection.createStatement(); try { statement.execute(explainRequest); } finally { statement.close(); } return getPlanOutput(connection, statementId); } } finally { if (!connection.getAutoCommit()) { connection.rollback(); } connection.close(); } } return null; } DatabaseInformations(int selectedRequestIndex); static int parseRequestIndex(String requestIndex); int getNbColumns(); int getSelectedRequestIndex(); String getSelectedRequestName(); String[][] getResult(); List<String> getRequestNames(); static String explainPlanFor(String sqlRequest); @Override String toString(); }
DatabaseInformations implements Serializable { public static String explainPlanFor(String sqlRequest) throws SQLException, NamingException { final Connection connection = getConnection(); if (connection != null) { try { final Database database = Database.getDatabaseForConnection(connection); if (database == Database.ORACLE) { final String statementId = String.valueOf(sqlRequest.hashCode()); final String explainRequest = buildExplainRequest(sqlRequest, statementId); final Statement statement = connection.createStatement(); try { statement.execute(explainRequest); } finally { statement.close(); } return getPlanOutput(connection, statementId); } } finally { if (!connection.getAutoCommit()) { connection.rollback(); } connection.close(); } } return null; } DatabaseInformations(int selectedRequestIndex); static int parseRequestIndex(String requestIndex); int getNbColumns(); int getSelectedRequestIndex(); String getSelectedRequestName(); String[][] getResult(); List<String> getRequestNames(); static String explainPlanFor(String sqlRequest); @Override String toString();  }