Author: shawkins
Date: 2010-04-30 10:24:40 -0400 (Fri, 30 Apr 2010)
New Revision: 2087
Modified:
trunk/build/kits/jboss-container/teiid-examples/simpleclient/JDBCClient.class
trunk/build/kits/jboss-container/teiid-examples/simpleclient/JDBCClient.java
Log:
fixing the client parameter ordering and adding an example of using showplan
Modified: trunk/build/kits/jboss-container/teiid-examples/simpleclient/JDBCClient.class
===================================================================
(Binary files differ)
Modified: trunk/build/kits/jboss-container/teiid-examples/simpleclient/JDBCClient.java
===================================================================
---
trunk/build/kits/jboss-container/teiid-examples/simpleclient/JDBCClient.java 2010-04-30
14:22:36 UTC (rev 2086)
+++
trunk/build/kits/jboss-container/teiid-examples/simpleclient/JDBCClient.java 2010-04-30
14:24:40 UTC (rev 2087)
@@ -27,6 +27,7 @@
import java.sql.Statement;
import org.teiid.jdbc.TeiidDataSource;
+import org.teiid.jdbc.TeiidStatement;
public class JDBCClient {
public static void main(String[] args) throws Exception {
@@ -44,20 +45,23 @@
execute(getDataSourceConnection(args[0], args[1], args[2]), args[3]);
}
- static Connection getDriverConnection(String vdb, String host, String port) throws
Exception {
- String url =
"jdbc:metamatrix:"+vdb+"@mm://"+host+":"+port;
+ static Connection getDriverConnection(String host, String port, String vdb) throws
Exception {
+ String url =
"jdbc:teiid:"+vdb+"@mm://"+host+":"+port+";showplan=on";
//note showplan setting
Class.forName("org.teiid.jdbc.TeiidDriver");
return DriverManager.getConnection(url,"admin", "teiid");
}
- static Connection getDataSourceConnection(String vdb, String host, String port) throws
Exception {
+ static Connection getDataSourceConnection(String host, String port, String vdb) throws
Exception {
TeiidDataSource ds = new TeiidDataSource();
ds.setDatabaseName(vdb);
ds.setUser("admin");
ds.setPassword("teiid");
ds.setServerName(host);
ds.setPortNumber(Integer.valueOf(port));
+
+ ds.setShowPlan("on"); //turn show plan on
+
return ds.getConnection();
}
@@ -77,6 +81,10 @@
}
System.out.println("");
}
+
+ System.out.println("Query Plan");
+ System.out.println(statement.unwrap(TeiidStatement.class).getPlanDescription());
+
results.close();
statement.close();
} catch (SQLException e) {
Show replies by date