Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DTP » Programmatically DB access connection via DTP on Eclipse 3.5 (Galileo)(Programmatically DB access connection via DTP on Eclipse 3.5 (Galileo))
Programmatically DB access connection via DTP on Eclipse 3.5 (Galileo) [message #490663] Fri, 09 October 2009 11:33 Go to next message
No real name is currently offline No real name
Messages: 14
Registered: October 2009
Junior Member
I don't understand how to connect code-side to my Connection Profile created in the Database Development Perspective.

My tree is here:

Database Connections
- test (MySQL v. 5.0.0)
-- test
---Authorization IDs
---Schemas
---- ...

I changed perspective to Plug-in development coding
IConnectionProfile profile = ProfileManager.getInstance().getProfileByName("test");
without any result.

I also tried this:

IConnectionProfile[] profile = ProfileManager.getInstance().getProfiles();
logger.info("!! profiles " + profile.length);
for (IConnectionProfile iConnectionProfile : profile) {
logger.info("!! iConnectionProfile ************************ ");
logger.info("!! getName "+iConnectionProfile.getName());
logger.info("!! getDescription "+iConnectionProfile.getDescription());
logger.info("!! getInstanceID "+iConnectionProfile.getInstanceID());
}

but the length of profiles is always empty (returning 0).

What else can I do? Neutral

Thank you in advance,

Le
Re: Programmatically DB access connection via DTP on Eclipse 3.5 (Galileo) [message #491503 is a reply to message #490663] Wed, 14 October 2009 15:42 Go to previous message
Brian Fitzpatrick is currently offline Brian Fitzpatrick
Messages: 495
Registered: July 2009
Senior Member
That's very odd...

If "test" is showing up as a database profile in the data source
explorer... This should do the trick:

IConnectionProfile profile =
ProfileManager.getInstance().getProfileByName("test");

Can you tell me a bit about the code where you're trying to get the
profile handle from? Is it in a RCP app? If so, can you try doing the
same thing in the Eclipse Workbench?

--Fitz


lero@email.it wrote:
> I don't understand how to connect code-side to my Connection Profile
> created in the Database Development Perspective.
>
> My tree is here:
>
> Database Connections
> - test (MySQL v. 5.0.0)
> -- test
> ---Authorization IDs
> ---Schemas
> ---- ...
>
> I changed perspective to Plug-in development coding
> IConnectionProfile profile =
> ProfileManager.getInstance().getProfileByName("test");
> without any result.
>
> I also tried this:
>
> IConnectionProfile[] profile =
> ProfileManager.getInstance().getProfiles();
> logger.info("!! profiles " + profile.length);
> for (IConnectionProfile iConnectionProfile : profile) {
> logger.info("!! iConnectionProfile ************************ ");
> logger.info("!! getName "+iConnectionProfile.getName());
> logger.info("!! getDescription
> "+iConnectionProfile.getDescription());
> logger.info("!! getInstanceID
> "+iConnectionProfile.getInstanceID());
> }
>
> but the length of profiles is always empty (returning 0).
>
> What else can I do? :|
>
> Thank you in advance,
>
> Le
Previous Topic:Programmatically access a JDBC connection via DTP
Next Topic:Programmatically DB access connection via DTP on Eclipse 3.5 (Galileo)
Goto Forum:
  


Current Time: Fri Apr 18 22:05:34 EDT 2014

Powered by FUDForum. Page generated in 0.01917 seconds