db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Db-derby Wiki] Update of "MultiConnectionTip" by BryanPendleton
Date Sat, 11 Feb 2006 17:21:13 GMT
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:

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.

View raw message