|
Re: Any way to map from ConnectionProfile to DatabaseDefinition? [message #50314 is a reply to message #50253] |
Mon, 29 September 2008 14:58 |
Eclipse User |
|
|
|
Originally posted by: brianf.sybase.com
Hi Philipp!
You bet. You can do something similar to what I described in a blog post a
couple of months ago.
public Database getDatabaseForProfile (IConnectionProfile profile) {
IManagedConnection managedConnection = ((IConnectionProfile)profile).
getManagedConnection
(" org.eclipse.datatools.connectivity.sqm.core.connection.Conne ctionInfo ");
if (managedConnection != null) {
try {
ConnectionInfo connectionInfo = (ConnectionInfo)
managedConnection.
getConnection().getRawConnection();
if (connectionInfo != null) {
return connectionInfo.getSharedDatabase();
}
} catch (Exception e) {
e.printStackTrace();
}
}
return null;
}
This example gets you most of the way there. The ConnectionInfo class has a
"getDatabaseDefinition()" method that will get you what you're looking for.
Hope that helps!
--Fitz
"Philipp Simon" <philipp_simon@web.de> wrote in message
news:d05c401b826404aa8d461b40dc240863$1@www.eclipse.org...
> Hi guys,
>
> i am looking for a way to look up a DatabaseDefinition starting from a
> ConnectionProfile. After trying quite some ways it looks to me like there
> is no "official" way to link them. Is this correct or do i miss something
> essential?
>
> Thanks in advance,
> Philipp
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.04171 seconds