org.apache.derby.tools.JDBCDisplayUtil
| Modifier and Type | Field and Description |
|---|---|
| private static final Class | |
| private String | |
| private static final String[][] | |
| private static final Class |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static void | DisplayMulti(LocalizedOutput out, PreparedStatement ps, ResultSet rs, Connection conn)
Display a statement that takes parameters by stuffing it with rows from the result set and displaying each result each time through. |
| public static void | |
| public static String | |
| public static Connection | getDataSourceConnection(String
Data Source name dsName, String User name user, String Password password, String Database Name dbName, boolean Indicates if the method is called first time. This is passed to setupDataSource
method. firstTime)Returns a connection obtained using the DataSource. |
| public static String | Returns: the name of the first argument not preceded by "-p", null if none found.the argument list to consider. args)Return the name of the ij command file or null if none is specified. |
| public static String | getInputResourceNameArg(String[] args)
Return the name of a resource containing input commands or null iff none has been specified. |
| public static boolean | Returns: true if a property item was found and loaded.the argument list to consider. args)ij is started with "-p[r] file OtherArgs"; the file contains properties to control the driver and database used to run ij, and can provide additional system properties. |
| pack-priv static InputStream | Returns: a buffered stream for the resource if it exists and null otherwise.the name of the resource resourceName)Convenience routine to get a resource as a BufferedInputStream. |
| public static String | Returns: the current schema of the connection, or null if error.Connection to get current schema for theConnection)Selects the current schema from the given connection. |
| pack-priv static final String | |
| public static boolean | Returns: true if the args are invalid
Verify the ij line arguments command arguments. |
| private static boolean | Returns: true if the framework contains Net or JCC.Used to determine if this is a JCC testing framework So that retrieveMessages can be sent. |
| pack-priv static void | |
| public static void | loadDriverIfKnown(String
the protocol to try. jdbcProtocol)Find the appropriate driver and load it, given a JDBC URL. |
| private static void | loadWithTrimmedValues(InputStream
An input stream from which the new properties are to be
loaded (should already be initialized). iStr, Properties A set of properties to which the properties from
iStr will be added (should already be initialized).
Copied here to avoid dependency on an engine class. prop)Read a set of properties from the received input stream, strip off any excess white space that exists in those property values, and then add those newly-read properties to the received Properties object; not explicitly removing the whitespace here can lead to problems. |
| pack-priv static String | qualifyResourceName(String resourceName, boolean
true means return null if the name is not absolute and false
means return partial names. absolute)Convenience routine to qualify a resource name with "ij.defaultPackageName" if it is not qualified (does not begin with a "/"). |
| public final String | |
| public static void | setupDataSource(Object
DataSource object ds, String Database Name dbName, boolean If firstTime is false, ij.dataSource.createDatabase and ij.dataSource.databaseName
properties will not be used. The value in parameter dbName will be used instead of
ij.dataSource.databaseName. firstTime)Sets up a data source with values specified in ij.dataSource.* properties or passed as parameters of this method |
| public static Connection | Returns: a connection to the defaultURL if possible; null if not.the driver to use if no property value found defaultDriver, String the database URL to use if no property value found defaultURL, Properties Connection attributes to pass to getConnection connInfo)This will look for the System properties "ij.driver" and "ij.database" and return a java.sql.Connection if it successfully connects. |
| public static Connection | Returns: a connection to the defaultURL if possible; null if not.Utility interface that defaults driver and database to null. |
| public static Connection | |
| public static Properties | |
| pack-priv static void |
| INT_P | back to summary |
|---|---|
| private static final Class<T>[] INT_P | |
| key | back to summary |
|---|---|
| private String key | |
| protocolDrivers | back to summary |
|---|---|
| private static final String[][] protocolDrivers | |
| STRING_P | back to summary |
|---|---|
| private static final Class<T>[] STRING_P | |
| util | back to summary |
|---|---|
| private util() | |
| DisplayMulti | back to summary |
|---|---|
| public static void DisplayMulti(LocalizedOutput out, PreparedStatement ps, ResultSet rs, Connection conn) throws SQLException, ijException Display a statement that takes parameters by stuffing it with rows from the result set and displaying each result each time through. Deal with autocommit behavior along the way.
| |
| DisplayVector | back to summary |
|---|---|
| public static void DisplayVector(LocalizedOutput out, Vector<E> v) Display a vector of strings to the out stream. | |
| getArg | back to summary |
|---|---|
| public static String getArg(String param, String[] args) Find the argument that follows the specified parameter. | |
| getDataSourceConnection | back to summary |
|---|---|
| public static Connection getDataSourceConnection(String dsName, String user, String password, String dbName, boolean firstTime) throws SQLException Returns a connection obtained using the DataSource. This method will be called when ij.dataSource property is set. It uses ij.dataSource.* properties to get details for the connection. | |
| getFileArg | back to summary |
|---|---|
| public static String getFileArg(String[] args) throws IOException Return the name of the ij command file or null if none is specified. The command file may be proceeded with -f flag on the command line. Alternatively, the command file may be specified without a -f flag. In this case we assume the first unknown argument is the command file. This should only be called after calling invalidArgs. If there is no such argument, a null is returned.
| |
| getInputResourceNameArg | back to summary |
|---|---|
| public static String getInputResourceNameArg(String[] args) Return the name of a resource containing input commands or null iff none has been specified. | |
| getPropertyArg | back to summary |
|---|---|
| public static boolean getPropertyArg(String[] args) throws IOException ij is started with "-p[r] file OtherArgs"; the file contains properties to control the driver and database used to run ij, and can provide additional system properties.
getPropertyArg will look at the args and take out a "-p
If there was a -p without a following the argument list to consider.
true if a property item was found and loaded.
| |
| getResourceAsStream | back to summary |
|---|---|
| pack-priv static InputStream getResourceAsStream(String resourceName) Convenience routine to get a resource as a BufferedInputStream. If the resourceName is not absolute (does not begin with a "/") this qualifies the name with the "ij.defaultResourcePackage" name.
| |
| getSelectedSchema | back to summary |
|---|---|
| public static String getSelectedSchema(Connection theConnection) throws SQLException Selects the current schema from the given connection. As there are no way of getting current schema supported by all major DBMS-es, this method may return null.
| |
| getSystemProperty | back to summary |
|---|---|
| pack-priv static final String getSystemProperty(String propertyName) | |
| invalidArgs | back to summary |
|---|---|
| public static boolean invalidArgs(String[] args) Verify the ij line arguments command arguments. Also used to detect --help.
| |
| isJCCFramework | back to summary |
|---|---|
| private static boolean isJCCFramework() Used to determine if this is a JCC testing framework So that retrieveMessages can be sent. The plan is to have ij will retrieve messages by default and not look at the testing frameworks. So, ulitmately this function will look at the driver rather than the framework.
| |
| loadDriver | back to summary |
|---|---|
| pack-priv static void loadDriver(String driverClass) throws ClassNotFoundException, InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException Load a driver given a class name.
| |
| loadDriverIfKnown | back to summary |
|---|---|
| public static void loadDriverIfKnown(String jdbcProtocol) throws ClassNotFoundException, InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException Find the appropriate driver and load it, given a JDBC URL. No action if no driver known for a given URL.
| |
| loadWithTrimmedValues | back to summary |
|---|---|
| private static void loadWithTrimmedValues(InputStream iStr, Properties prop) throws IOException Read a set of properties from the received input stream, strip off any excess white space that exists in those property values, and then add those newly-read properties to the received Properties object; not explicitly removing the whitespace here can lead to problems. This method exists because of the manner in which the jvm reads properties from file--extra spaces are ignored after a _key_, but if they exist at the _end_ of a property decl line (i.e. as part of a _value_), they are preserved, as outlined in the Java API: "Any whitespace after the key is skipped; if the first non- whitespace character after the key is = or :, then it is ignored and any whitespace characters after it are also skipped. All remaining characters on the line become part of the associated element string." Creates final properties set consisting of 'prop' plus all properties loaded from 'iStr' (with the extra whitespace (if any) removed from all values), will be returned via the parameter.
| |
| qualifyResourceName | back to summary |
|---|---|
| pack-priv static String qualifyResourceName(String resourceName, boolean absolute) Convenience routine to qualify a resource name with "ij.defaultPackageName" if it is not qualified (does not begin with a "/").
| |
| run | back to summary |
|---|---|
| public final String run() | |
| setupDataSource | back to summary |
|---|---|
| public static void setupDataSource(Object ds, String dbName, boolean firstTime) throws Exception Sets up a data source with values specified in ij.dataSource.* properties or passed as parameters of this method | |
| startJBMS | back to summary |
|---|---|
| public static Connection startJBMS(String defaultDriver, String defaultURL, Properties connInfo) throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException This will look for the System properties "ij.driver" and "ij.database" and return a java.sql.Connection if it successfully connects. The deprecated driver and database properties are examined first. If no connection was possible, it will return a null. Failure to load the driver class is quietly ignored.
| |
| startJBMS | back to summary |
|---|---|
| public static Connection startJBMS() throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException Utility interface that defaults driver and database to null.
| |
| startJBMS | back to summary |
|---|---|
| public static Connection startJBMS(String defaultDriver, String defaultURL) throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException Utility interface that defaults connInfo to null
| |
| updateConnInfo | back to summary |
|---|---|
| public static Properties updateConnInfo(String user, String password, Properties connInfo) | |
| Usage | back to summary |
|---|---|
| pack-priv static void Usage(LocalizedOutput out) print a usage message for invocations of main(). | |