You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by Apache Wiki <wi...@apache.org> on 2006/02/11 18:21:13 UTC

[Db-derby Wiki] Update of "MultiConnectionTip" by BryanPendleton

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Db-derby Wiki" for change notification.

The following page has been changed by BryanPendleton:
http://wiki.apache.org/db-derby/MultiConnectionTip

New page:
Sometimes when you are writing a test, it is useful to work with
multiple connections inside your IJ test script.

IJ supports multi-connection scripts elegantly, using the "show connections"
and "set connection" commands. There is also the ability to name a
connection, so you don't have to refer to them as Connection 1,
Connection 2, etc.

When you are writing an IJ script for a regression test, this feature
is somewhat more subtle, because generally the connection has already
been established by the test harness. You don't want to open a
connection to a hard-coded URL inside the script, because that would
not work with different frameworks (DerbyNet versus embedded, for example).

The solution is that you can use abbreviated connection urls in IJ,
omitting the scheme and framework information from the beginning of
the URL, and IJ will then use whatever framework it is currently
running under.

See jdbcapi/users.sql for an example:

    * connect 'wombat;shutdown=true;user=francois;password=paceesalute';
    * connect 'myDB;create=true;user=dan;password=MakeItFaster';

Thanks to Knut Anders for this observation.