background image
<< Rollback command | SHOW INDEXES >>

Set Connection command

<< Rollback command | SHOW INDEXES >>
Derby Tools and Utilities Guide
49
ij> run 'setupMenuConn.ij';
ij> -- this is setupMenuConn.ij
-- ij displays its contents as it processes file
ij> connect 'jdbc:derby:menuDB';
ij> autocommit off;
ij> -- this is the end of setupMenuConn.ij
-- there is now a connection to menuDB and no autocommit.
-- input will now resume from the previous source.
;
ij>
Set Connection command
Syntax
SET CONNECTION
Identifier
Description
Allows you to specify which connection to make current when you have more than one
connection open. Use the
Show Connections
command to display open connections.
If there is no such connection, an error results and the current connection is unchanged.
Example
ij> protocol 'jdbc:derby:';
ij> connect 'sample' as sample1;
ij> connect 'newDB;create=true' as newDB;
ij (NEWDB)> show connections;
SAMPLE1 - jdbc:derby:sample
NEWDB* - jdbc:derby:newDB;create=true
* = current connection
ij(NEWDB)> set connection sample1;
ij(SAMPLE1)> disconnect all;
ij>
Show command
Syntax
SHOW
{
CONNECTIONS |
FUNCTIONS [ IN schemaName ] |
INDEXES [ IN schemaName | FROM table-Name ] |
PROCEDURES [ IN schemaName ] |
ROLES |
ENABLED_ROLES |
SETTABLE_ROLES |
SCHEMAS |
SYNONYMS [ IN schemaName ] |
TABLES [ IN schemaName ] |
VIEWS [ IN schemaName ] |
}
Description
The SHOW command can be used to display information about active connections and
database objects.
SHOW CONNECTIONS
If there are no connections, the SHOW CONNECTIONS command returns "No
connections available".