From teiid-commits at lists.jboss.org Sun Apr 11 23:02:55 2010 Content-Type: multipart/mixed; boundary="===============0504893035241845315==" MIME-Version: 1.0 From: teiid-commits at lists.jboss.org To: teiid-commits at lists.jboss.org Subject: [teiid-commits] teiid SVN: r2050 - trunk/documentation/reference/src/main/docbook/en-US/content. Date: Sun, 11 Apr 2010 23:02:54 -0400 Message-ID: <201004120302.o3C32svw008235@svn01.web.mwc.hst.phx2.redhat.com> --===============0504893035241845315== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: shawkins Date: 2010-04-11 23:02:54 -0400 (Sun, 11 Apr 2010) New Revision: 2050 Modified: trunk/documentation/reference/src/main/docbook/en-US/content/federated_p= lanning.xml Log: TEIID-1040 changing to document the use of set statements Modified: trunk/documentation/reference/src/main/docbook/en-US/content/fede= rated_planning.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/documentation/reference/src/main/docbook/en-US/content/federated_= planning.xml 2010-04-12 01:49:40 UTC (rev 2049) +++ trunk/documentation/reference/src/main/docbook/en-US/content/federated_= planning.xml 2010-04-12 03:02:54 UTC (rev 2050) @@ -301,24 +301,13 @@ default for all queries in a Connection with either setPartialResultsMode("true") on a DataSource or partialResultsMode=3Dtrue on a JDBC URL. In either case, partial - results mode may be overridden on a per-query basis by setting - the execution property on the Statement. To set this property, - cast to the Teiid Statement JDBC API extension interface - org.teiid.jdbc.TeiidStatement - + results mode may be overridden with a set statement. Example - Setting Partial Results Mode Statement statement =3D ...obtain statement from= Connection... = - -TeiidStatement mmStatement =3D statement.unWrap(TeiidStatement.class); - = -mmStatement.setExecutionProperty( = - ExecutionProperties.PROP_PARTIAL_RESULTS_MODE, "true"); +statement.execute("set partialResultsMode true"); - This property can be set before each execution (via an - execute method) on a Statement (or PreparedStatement or - CallableStatement). Source Unavailability @@ -354,7 +343,7 @@ Example - Printing List of Failed Sources - statement.setExecutionProperty( PROP_PARTIAL_RES= ULTS_MODE, "true"); = + statement.execute("set partialResultsMode true"); ResultSet results =3D statement.executeQuery("SELECT Name FROM Accounts"); = SQLWarning warning =3D statement.getWarnings(); = if(warning instanceof PartialResultsWarning) { = @@ -404,19 +393,12 @@ Retrieving a Query Plan - TeiidStatement mmstatement =3D statement.unWrap(Te= iidStatement.class); -String sql =3D "select ..."; - -mmstatement.setExecutionProperty(ExecutionProperties.PROP_SQL_OPTIONS, Exe= cutionProperties.SQL_OPTION_SHOWPLAN); -//or -//sql +=3D " OPTION SHOWPLAN"; -//or -//sql +=3D " OPTION PLANONLY"; - -ResultSet rs =3D statement.executeQuery(sql); - -PlanNode queryPlan =3D mmstatement.getPlanDescription(); -System.out.println(XMLOutputVisitor.convertToXML(queryPlan); + +statement.execute("set showplan on"); +ResultSet rs =3D statement.executeQuery("select ..."); +TeiidStatement tstatement =3D statement.unWrap(TeiidStatement.class); +PlanNode queryPlan =3D tstatement.getPlanDescription(); +System.out.println(queryPlan); The query plan is made available automatically in several of Teiid's tools. --===============0504893035241845315==--