org.teiid.adminshell
Class GroovySqlExtensions

java.lang.Object
  extended by org.teiid.adminshell.GroovySqlExtensions

public class GroovySqlExtensions
extends java.lang.Object

Extensions of Groovy Sql support, which somewhat bridges the gap to our old adminshell sql logic


Constructor Summary
GroovySqlExtensions()
           
 
Method Summary
static TeiidSql connect()
           
static TeiidSql connect(java.lang.String url)
           
static TeiidSql connect(java.lang.String url, java.lang.String user, java.lang.String password)
           
static java.lang.String resultSetMetaDataToString(java.sql.ResultSetMetaData rsmd)
           
static java.lang.String rowToString(java.sql.ResultSet results)
           
static void sqlHelp()
           
static void sqlHelp(java.lang.String method)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroovySqlExtensions

public GroovySqlExtensions()
Method Detail

connect

@Help.Doc(text="Get a Teiid connection with a URL")
public static TeiidSql connect(@Help.Doc(text="url")
                                            java.lang.String url)
                        throws java.sql.SQLException
Throws:
java.sql.SQLException

connect

@Help.Doc(text="Get a Teiid connection")
public static TeiidSql connect(@Help.Doc(text="url")
                                            java.lang.String url,
                                            @Help.Doc(text="user")
                                            java.lang.String user,
                                            @Help.Doc(text="password")
                                            java.lang.String password)
                        throws java.sql.SQLException
Throws:
java.sql.SQLException

connect

@Help.Doc(text="Get a SQL connection using the defaults from connection.properties")
public static TeiidSql connect()
                        throws java.sql.SQLException
Throws:
java.sql.SQLException

rowToString

@Help.Doc(text="Alternate row to String method that pretty prints SQL/XML",
          moreText="e.g. sql.eachRow(\"select * from tables\", {row -> println rowToString(row) })")
public static java.lang.String rowToString(java.sql.ResultSet results)
                                    throws java.sql.SQLException
Throws:
java.sql.SQLException

resultSetMetaDataToString

@Help.Doc(text="Pretty prints the ResultSetMetadata",
          moreText={"e.g. sql.eachRow(\"select * from tables\", {rsmd -> println resultSetMetaDataToString(rsmd)},","                {row -> println rowToString(row) })"})
public static java.lang.String resultSetMetaDataToString(java.sql.ResultSetMetaData rsmd)
                                                  throws java.sql.SQLException
Throws:
java.sql.SQLException

sqlHelp

@Help.Doc(text="Show help for all SQL Extension methods")
public static void sqlHelp()

sqlHelp

@Help.Doc(text="Show help for the given SQL Extension method")
public static void sqlHelp(@Help.Doc(text="method name")
                                        java.lang.String method)


Copyright © 2010. All Rights Reserved.