On 3/28/14 6:05 AM, Dyre Tjeldvoll wrote:
Hi,
I'm faced with a situation where I'm passed a Derby connection object
and would like to create another connection to the same database.
Through DatabaseMetaData.getURL() I can get the "base url", i.e. just
the protocol and the database file name. But is there a way to get the
properties used to create the connection? Without the properties it
may not be possible to connect to the "base URL", e.g. if original
connection was to an encrypted database.
Hi Dyre,
Not that I'm aware of. The DataSource abstraction is useful for
remembering this kind of context. But Connections don't give you this
kind of metadata. Maybe you could add a cloneMe() method to
EmbedConnection. Retrieving the connection attributes would raise some
interesting security problems. E.g., handing back the original password
in cleartext sounds dangerous to me.
Thanks,
-Rick
Is it even possible?