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. Thanks Eranda
On Wed, Apr 14, 2010 at 1:42 PM, Knut Anders Hatlen <[email protected]>wrote: > On 04/13/10 09:50 PM, Eranda Sooriyabandara wrote: > > Hi, > > Are there any method which we can get the current database instance name? > > EmbedConnection has a public method called getDBName(), but that method > can only be used if you cast the connection instance to EmbedConnection, > and it only works on the embedded driver. If you want to get the > database name through the JDBC interfaces, I think you first need to get > the connection URL, > > String url = conn.getMetaData().getURL(); > > and then extract the database name part from the string. > > -- > Knut Anders > >
