To connect to a Derby database, you need to perform the following steps:
ij can work with any JDBC driver. For drivers supplied by other vendors, you need to load the driver separately. For drivers supplied by Derby, you can load the driver by specifying the full database connection URL in the connection. You do not need to load the driver explicitly in a second step.
To connect, specify the full database connection URL in a Connect command, ij.connection.connectionName property, or ij.database property.
D:>java org.apache.derby.tools.ij ij version 10.1 ij> connect 'jdbc:derby:sample'; ij>
For drivers supplied by Derby, specifying a protocol automatically loads the appropriate driver. You do not need to load the driver explicitly in a separate step. You specify a protocol with a property (ij.protocol or ij.protocol.protocolName) or command (Protocol).
To connect, specify the "short form" of the database connection URL in a Connect command, ij.connection.connectionName property, or ij.database property. A short form of the database connection URL eliminates the protocol (For more information, see About Protocols).
D:>java org.apache.derby.tools.ij ij version 10.1 ij> protocol 'jdbc:derby:'; ij> connect 'sample'; ij> D:>java -Dij.protocol.myprotocolName=jdbc:derby: org.apache.derby.tools.ij ij version 10.1 ij> connect 'sample' protocol myprotocolName; ij>
If you are using the drivers supplied by Derby, use the driver names listed in JDBC drivers overview. The Derby drivers are implicitly loaded when a supported protocol is used. Any other driver has to be explicitly loaded. You can load a driver explicitly with an ij property (ij.Driver), a system property (jdbc.drivers), or a command (Driver).
To connect, specify the full database connection URL in a Connect command, ij.connection.connectionName property, or ij.database property.
D:>java org.apache.derby.tools.ij ij version 10.1 ij> driver 'sun.jdbc.odbc.JdbcOdbcDriver'; ij> connect 'jdbc:odbc:myOdbcDataSource'; ij>