db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <Knut.Hat...@Sun.COM>
Subject Re: Get database name
Date Wed, 14 Apr 2010 21:03:27 GMT
On 04/14/10 22:15, Eranda Sooriyabandara wrote:
> Hi Knut,
> Thanks. Also is there a way to get the current database name within the
> code?
> The purpose is to print the current database name to the log.

Hi Eranda,

It should be possible to call EmbedConnection.getDBName() from within
the code as well, if a connection has been created. But exactly how to
get the database name depends on where in the code you need to get it
from. Is this question about DERBY-4601? If so, I guess that means
you'll want to get it from InternalDriver and/or EmbedConnection. In
InternalDriver, you typically have the URL and need to call the helper
method getDatabaseName() to extract the name. In EmbedConnection, you
can simply call getDBName() or tr.getDBName().

Knut Anders

View raw message