Home » Eclipse Projects » DTP » creating an IConnectionProfile using ConnectionProfileFactory.createConnection(How to get the constants for the createConnection API)
| | |
Re: creating an IConnectionProfile using ConnectionProfileFactory.createConnection [message #546714 is a reply to message #545489] |
Tue, 13 July 2010 22:01 |
Brian Fitzpatrick Messages: 500 Registered: July 2009 |
Senior Member |
|
|
Hi Shikhar...
Sorry for the delay...
If you look for org.eclipse.datatools.connectivity.sqm.core.SQMServices,
you'll see that it has a method that provides a
ProviderIDMappingRegistry instance. From that, using the vendor/version
combination, you can use getProviderIDforVendorVersion (vendor, version)
to return the provider ID for the connection profile, and use
getCategoryIDforProviderID (providerID) to get to the driver template
category.
Once you have the driver template category, you can use
org.eclipse.datatools.connectivity.drivers.models.CategoryDe scriptor to
get the driver category instance, which will return a list of the driver
templates for the category.
It's the long way around, but it should work...
The trick for DB2 is knowing whether it's DB2 UDB, DB2 UDB zSeries, DB2
UDB iSeries, etc. and knowing what the version is the driver template is
registered against.
By using CategoryDescriptor and TemplateDescriptor, you may be able to
ferret those values out via API. And the JDBC driver you're using may be
able to provide the vendor and version strings. It's just a matter of
figuring out what you have available.
Hope that helps a little and doesn't just muddy the water.
--Fitz
shikhar wrote:
> Hi Brian,
>
> Thanks for your reply The function definition looks like
> IConnectionProfile createConnection(String profileName, String vendorId,
> String versionId, String templateId, Properties properties)
> The ultimate goal is the connection profile instance but for that I need
> the vendor, version strings(to call this function). For example the
> Oracle vendorId string would be
> org.eclipse.datatools.enablement.oracle.driverCategory
> versionId would be (for the 10th edition)
> org.eclipse.datatools.enablement.oracle.10.driverCategory
>
> Now this is a hard coded call. Lets assume that what I have in hand is
> oracle and its version lets say V10. So how do I get these strings -
> org.eclipse.datatools.enablement.oracle.driverCategory, etc. Same with
> DB2. lets say I have the string DB2 its version string as V9. How do I
> covert them to org.eclipse.datatools.enablement.db2.somethingSoemthing
> so that I am able to pass it to the function call.
> The guess the answer will lie in the enablement plugins. thanks and
> hoping to hear from you soon. Shikhar
>
>
>
|
|
| |
Re: creating an IConnectionProfile using ConnectionProfileFactory.createConnection [message #597624 is a reply to message #597615] |
Tue, 13 July 2010 22:01 |
Brian Fitzpatrick Messages: 500 Registered: July 2009 |
Senior Member |
|
|
Hi Shikhar...
Sorry for the delay...
If you look for org.eclipse.datatools.connectivity.sqm.core.SQMServices,
you'll see that it has a method that provides a
ProviderIDMappingRegistry instance. From that, using the vendor/version
combination, you can use getProviderIDforVendorVersion (vendor, version)
to return the provider ID for the connection profile, and use
getCategoryIDforProviderID (providerID) to get to the driver template
category.
Once you have the driver template category, you can use
org.eclipse.datatools.connectivity.drivers.models.CategoryDe scriptor to
get the driver category instance, which will return a list of the driver
templates for the category.
It's the long way around, but it should work...
The trick for DB2 is knowing whether it's DB2 UDB, DB2 UDB zSeries, DB2
UDB iSeries, etc. and knowing what the version is the driver template is
registered against.
By using CategoryDescriptor and TemplateDescriptor, you may be able to
ferret those values out via API. And the JDBC driver you're using may be
able to provide the vendor and version strings. It's just a matter of
figuring out what you have available.
Hope that helps a little and doesn't just muddy the water.
--Fitz
shikhar wrote:
> Hi Brian,
>
> Thanks for your reply The function definition looks like
> IConnectionProfile createConnection(String profileName, String vendorId,
> String versionId, String templateId, Properties properties)
> The ultimate goal is the connection profile instance but for that I need
> the vendor, version strings(to call this function). For example the
> Oracle vendorId string would be
> org.eclipse.datatools.enablement.oracle.driverCategory
> versionId would be (for the 10th edition)
> org.eclipse.datatools.enablement.oracle.10.driverCategory
>
> Now this is a hard coded call. Lets assume that what I have in hand is
> oracle and its version lets say V10. So how do I get these strings -
> org.eclipse.datatools.enablement.oracle.driverCategory, etc. Same with
> DB2. lets say I have the string DB2 its version string as V9. How do I
> covert them to org.eclipse.datatools.enablement.db2.somethingSoemthing
> so that I am able to pass it to the function call.
> The guess the answer will lie in the enablement plugins. thanks and
> hoping to hear from you soon. Shikhar
>
>
>
|
|
|
Goto Forum:
Current Time: Tue Apr 23 07:08:57 GMT 2024
Powered by FUDForum. Page generated in 0.05481 seconds
|