[teiid-commits] teiid SVN: r1924 - trunk/build/kit-runtime/examples/simpleclient.
teiid-commits at lists.jboss.org
teiid-commits at lists.jboss.org
Fri Mar 5 13:58:44 EST 2010
Author: shawkins
Date: 2010-03-05 13:58:44 -0500 (Fri, 05 Mar 2010)
New Revision: 1924
Added:
trunk/build/kit-runtime/examples/simpleclient/JDBCClient.class
Removed:
trunk/build/kit-runtime/examples/simpleclient/JDBCClient.class
Modified:
trunk/build/kit-runtime/examples/simpleclient/JDBCClient.java
Log:
TEIID-833 committing JCA merge
Deleted: trunk/build/kit-runtime/examples/simpleclient/JDBCClient.class
===================================================================
(Binary files differ)
Added: trunk/build/kit-runtime/examples/simpleclient/JDBCClient.class
===================================================================
(Binary files differ)
Property changes on: trunk/build/kit-runtime/examples/simpleclient/JDBCClient.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/build/kit-runtime/examples/simpleclient/JDBCClient.java
===================================================================
--- trunk/build/kit-runtime/examples/simpleclient/JDBCClient.java 2010-03-05 18:21:18 UTC (rev 1923)
+++ trunk/build/kit-runtime/examples/simpleclient/JDBCClient.java 2010-03-05 18:58:44 UTC (rev 1924)
@@ -30,37 +30,34 @@
public class JDBCClient {
public static void main(String[] args) throws Exception {
- if (args.length < 2) {
- System.out.println("usage: JDBCClient <vdb> <sql-command>");
+ if (args.length < 4) {
+ System.out.println("usage: JDBCClient <host> <port> <vdb> <sql-command>");
System.exit(-1);
}
System.out.println("Executing using the TeiidDriver");
- execute(getDriverConnection(args[0]), args[1]);
+ execute(getDriverConnection(args[0], args[1], args[2]), args[3]);
System.out.println("");
System.out.println("Executing using the TeiidDataSource");
// this is showing how to make a Data Source connection.
- execute(getDataSourceConnection(args[0]), args[1]);
+ execute(getDataSourceConnection(args[0], args[1], args[2]), args[3]);
}
- static Connection getDriverConnection(String vdb) throws Exception {
- String url = "jdbc:metamatrix:"+vdb+"@../../deploy.properties";
+ static Connection getDriverConnection(String vdb, String host, String port) throws Exception {
+ String url = "jdbc:metamatrix:"+vdb+"@mm://"+host+":"+port;
Class.forName("org.teiid.jdbc.TeiidDriver");
return DriverManager.getConnection(url,"admin", "teiid");
}
- static Connection getDataSourceConnection(String vdb) throws Exception {
+ static Connection getDataSourceConnection(String vdb, String host, String port) throws Exception {
TeiidDataSource ds = new TeiidDataSource();
ds.setDatabaseName(vdb);
ds.setUser("admin");
ds.setPassword("teiid");
- ds.setEmbeddedBootstrapFile("../../deploy.properties");
- /* Alternatively server mode would be
- * ds.setServerName("localhost");
- * ds.setPortNumber(31000);
- */
+ ds.setServerName(host);
+ ds.setPortNumber(Integer.valueOf(port));
return ds.getConnection();
}
More information about the teiid-commits
mailing list