NullPointerException while getting the ConnectionInfo [message #657108] |
Tue, 01 March 2011 10:52  |
Eclipse User |
|
|
|
Hi I'm trying to get the ConnectionInfo from a managedConnection but strangely I get a NullPointerException.
This is my code:
private IConnectionProfile getDatabaseConnectionProfile(
IConnectionProfile connectionProfile, String str_database)
{
IManagedConnection managedConnection = connectionProfile.
getManagedConnection("org.eclipse.datatools.connectivity.sqm." +
"core.connection.ConnectionInfo");
if(managedConnection != null){
ConnectionInfo conInfo = (ConnectionInfo) managedConnection.
getConnection().getRawConnection(); // NullPointerExcpetion is happening here
if(conInfo.getDatabaseName().equals(str_database)){
return connectionProfile;
}
}
return null;
}
At the moment I'm just a blockhead. I can't find the failure.
[Updated on: Tue, 01 March 2011 10:53] by Moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04188 seconds