Home » Eclipse Projects » DTP » access DTP connection profiles
access DTP connection profiles [message #41308] |
Thu, 07 February 2008 14:57 |
Eclipse User |
|
|
|
Originally posted by: c.sell.NOSPAM.byterefinery.de
Hello,
I am developing a database modeling tool which currently maintains its own
connection data. now I would like to integrate with DTP in such a way that
DTP connection profiles can be used for export/import purposes as well.
To achieve that, I would create an adapter plugin (dependencies on both
DTP and my plugin) from where I would read the DTP connection profile
information and adapt it to the needs of my tool.
Now comes the question: Can someone tell me how to access the currently
defined DTP connection profiles, and how to read database metadata through
such a profile?
thanks,
Christian
|
|
|
Re: access DTP connection profiles [message #41340 is a reply to message #41308] |
Thu, 07 February 2008 16:00 |
Eclipse User |
|
|
|
Originally posted by: brianf.sybase.com
Hi Christian...
You bet. This sounds like a cool tool. :)
As for how to get at the profile metadata, if you have DTP installed, you
have a plug-in called org.eclipse.datatools.connectivity. This has a class
in it called org.eclipse.datatools.connectivity.ProfileManager. From here,
you can get a list of existing connection profiles and then start fiddling
with their metadata.
Something like this will get you a list of database-related profiles:
IConnectionProfile[] databaseProfiles =
ProfileManager.getProfilesByCategory("org.eclipse.datatools.connectivity.db.category ");
From there, I'd take a look at the
org.eclipse.datatools.connectivity.drivers.jdbc.JDBCConnecti on class and
specifically it's createConnection (ClassLoader) method. You won't
necessarily need the classloader aspects of it, but it shows how to get the
various details out of a db profile needed to make a JDBC connection.
Hope that helps get you started. If you have more questions, don't hesitate
to ask.
--Fitz
Brian Fitzpatrick
Sybase, Inc.
Sr. Software Engineer
Data Tools Project Connectivity Team Lead/Committer
"Christian Sell" <c.sell@NOSPAM.byterefinery.de> wrote in message
news:8854a19b3fd0658244341dbde3fc2489$1@www.eclipse.org...
> Hello,
>
> I am developing a database modeling tool which currently maintains its own
> connection data. now I would like to integrate with DTP in such a way that
> DTP connection profiles can be used for export/import purposes as well.
> To achieve that, I would create an adapter plugin (dependencies on both
> DTP and my plugin) from where I would read the DTP connection profile
> information and adapt it to the needs of my tool.
>
> Now comes the question: Can someone tell me how to access the currently
> defined DTP connection profiles, and how to read database metadata through
> such a profile?
>
> thanks,
> Christian
>
|
|
|
Re: access DTP connection profiles [message #41369 is a reply to message #41340] |
Thu, 07 February 2008 17:24 |
Eclipse User |
|
|
|
Originally posted by: c.sell.NOSPAM.byterefinery.de
Hello Brian,
> You bet. This sounds like a cool tool. :)
yes, I thought I'd create something reaally unique ;)
> As for how to get at the profile metadata, if you have DTP installed, you
> have a plug-in called org.eclipse.datatools.connectivity. This has a class
> in it called org.eclipse.datatools.connectivity.ProfileManager. From here,
> you can get a list of existing connection profiles and then start fiddling
> with their metadata.
ot that. However, how can I be sure that the profiles returned here are
compatible with the JDBCConnectionFactory class?
> Something like this will get you a list of database-related profiles:
> IConnectionProfile[] databaseProfiles =
>
ProfileManager.getProfilesByCategory("org.eclipse.datatools.connectivity.db.category ");
> From there, I'd take a look at the
> org.eclipse.datatools.connectivity.drivers.jdbc.JDBCConnecti on class and
> specifically it's createConnection (ClassLoader) method. You won't
> necessarily need the classloader aspects of it, but it shows how to get the
> various details out of a db profile needed to make a JDBC connection.
it seems to me that your package reference is wrong.. I can only find a
JDBCConnection class in the org.eclipse.datatools.connectivity.db.generic
package. That class is marked as NON-API, however..
thanks,
Christian
|
|
|
Re: access DTP connection profiles [message #41400 is a reply to message #41369] |
Thu, 07 February 2008 17:49 |
Eclipse User |
|
|
|
Originally posted by: brianf.sybase.com
Everything in the Database category SHOULD conform to the
JDBCConnectionFactory class and everything should extend that. If you want
DTP to simply hand you a JDBC connection, you can get a profile and then
call:
myprofile.createConnection("java.sql.Connection");
which will give you an IConnection. Once you have the connection, you can
get the raw connection and see if that's a java.sql.Connection and just use
the connection itself.
The JDBCConnection class I'm looking at is in the
org.eclipse.datatools.connectivity.drivers.jdbc package of the
org.eclipse.datatools.connectivity plug-in. The one in the Generic JDBC
plug-in extends that.
--Fitz
"Christian Sell" <c.sell@NOSPAM.byterefinery.de> wrote in message
news:1509284840dc37253b4ea77c3c758bd4$1@www.eclipse.org...
> Hello Brian,
>
>> You bet. This sounds like a cool tool. :)
>
> yes, I thought I'd create something reaally unique ;)
>
>> As for how to get at the profile metadata, if you have DTP installed, you
>> have a plug-in called org.eclipse.datatools.connectivity. This has a
>> class in it called org.eclipse.datatools.connectivity.ProfileManager.
>> From here, you can get a list of existing connection profiles and then
>> start fiddling with their metadata.
>
> ot that. However, how can I be sure that the profiles returned here are
> compatible with the JDBCConnectionFactory class?
>
>> Something like this will get you a list of database-related profiles:
>
>> IConnectionProfile[] databaseProfiles =
> ProfileManager.getProfilesByCategory("org.eclipse.datatools.connectivity.db.category ");
>> From there, I'd take a look at the
>> org.eclipse.datatools.connectivity.drivers.jdbc.JDBCConnecti on class and
>> specifically it's createConnection (ClassLoader) method. You won't
>> necessarily need the classloader aspects of it, but it shows how to get
>> the various details out of a db profile needed to make a JDBC connection.
>
> it seems to me that your package reference is wrong.. I can only find a
> JDBCConnection class in the org.eclipse.datatools.connectivity.db.generic
> package. That class is marked as NON-API, however..
>
> thanks,
> Christian
>
>
>
|
|
|
Re: access DTP connection profiles [message #41429 is a reply to message #41400] |
Tue, 12 February 2008 13:56 |
Eclipse User |
|
|
|
Originally posted by: c.sell.NOSPAM.byterefinery.de
Brian Fitzpatrick wrote:
> The JDBCConnection class I'm looking at is in the
> org.eclipse.datatools.connectivity.drivers.jdbc package of the
> org.eclipse.datatools.connectivity plug-in. The one in the Generic JDBC
> plug-in extends that.
we seem to be looking at different codebases. The class I am looking at is
org.eclipse.datatools.connectivity.db.generic.JDBCConnection . It extends
org.eclipse.datatools.connectivity.DriverConnectionBase. And its marked as
NON-API
thanks,
Christian
|
|
|
Re: access DTP connection profiles [message #41459 is a reply to message #41429] |
Tue, 12 February 2008 21:22 |
Eclipse User |
|
|
|
Originally posted by: brianf.sybase.com
Hi Christian...
Even in the 1.5 stream, there's still a base JDBCConnection class in the
org.eclipse.datatools.connectivity plug-in and then the one in the generic
JDBC plug-in extends that.
Here's the class definition for
org.eclipse.datatools.connectivity.db.generic.JDBCConnection in
org.eclipse.datatools.connectivity.db.generic:
public class JDBCConnection extends
org.eclipse.datatools.connectivity.drivers.jdbc.JDBCConnecti on
Here's the class definition for
org.eclipse.datatools.connectivity.drivers.jdbc.JDBCConnecti on in
org.eclipse.datatools.connectivity:
public class JDBCConnection extends DriverConnectionBase
If you'd like to use a JDBCConnection class, I recommend you use the latter,
not the former.
Hope that helps clarify a bit.
--Fitz
"Christian Sell" <c.sell@NOSPAM.byterefinery.de> wrote in message
news:0e339574644c60ca3474b9e091dc8c47$1@www.eclipse.org...
> Brian Fitzpatrick wrote:
>
>> The JDBCConnection class I'm looking at is in the
>> org.eclipse.datatools.connectivity.drivers.jdbc package of the
>> org.eclipse.datatools.connectivity plug-in. The one in the Generic JDBC
>> plug-in extends that.
>
> we seem to be looking at different codebases. The class I am looking at is
> org.eclipse.datatools.connectivity.db.generic.JDBCConnection . It extends
> org.eclipse.datatools.connectivity.DriverConnectionBase. And its marked as
> NON-API
>
> thanks,
> Christian
>
|
|
|
Re: access DTP connection profiles [message #589866 is a reply to message #41308] |
Thu, 07 February 2008 16:00 |
Brian Fitzpatrick Messages: 500 Registered: July 2009 |
Senior Member |
|
|
Hi Christian...
You bet. This sounds like a cool tool. :)
As for how to get at the profile metadata, if you have DTP installed, you
have a plug-in called org.eclipse.datatools.connectivity. This has a class
in it called org.eclipse.datatools.connectivity.ProfileManager. From here,
you can get a list of existing connection profiles and then start fiddling
with their metadata.
Something like this will get you a list of database-related profiles:
IConnectionProfile[] databaseProfiles =
ProfileManager.getProfilesByCategory("org.eclipse.datatools.connectivity.db.category ");
From there, I'd take a look at the
org.eclipse.datatools.connectivity.drivers.jdbc.JDBCConnecti on class and
specifically it's createConnection (ClassLoader) method. You won't
necessarily need the classloader aspects of it, but it shows how to get the
various details out of a db profile needed to make a JDBC connection.
Hope that helps get you started. If you have more questions, don't hesitate
to ask.
--Fitz
Brian Fitzpatrick
Sybase, Inc.
Sr. Software Engineer
Data Tools Project Connectivity Team Lead/Committer
"Christian Sell" <c.sell@NOSPAM.byterefinery.de> wrote in message
news:8854a19b3fd0658244341dbde3fc2489$1@www.eclipse.org...
> Hello,
>
> I am developing a database modeling tool which currently maintains its own
> connection data. now I would like to integrate with DTP in such a way that
> DTP connection profiles can be used for export/import purposes as well.
> To achieve that, I would create an adapter plugin (dependencies on both
> DTP and my plugin) from where I would read the DTP connection profile
> information and adapt it to the needs of my tool.
>
> Now comes the question: Can someone tell me how to access the currently
> defined DTP connection profiles, and how to read database metadata through
> such a profile?
>
> thanks,
> Christian
>
|
|
|
Re: access DTP connection profiles [message #589883 is a reply to message #41340] |
Thu, 07 February 2008 17:24 |
Christian Sell Messages: 77 Registered: July 2009 |
Member |
|
|
Hello Brian,
> You bet. This sounds like a cool tool. :)
yes, I thought I'd create something reaally unique ;)
> As for how to get at the profile metadata, if you have DTP installed, you
> have a plug-in called org.eclipse.datatools.connectivity. This has a class
> in it called org.eclipse.datatools.connectivity.ProfileManager. From here,
> you can get a list of existing connection profiles and then start fiddling
> with their metadata.
ot that. However, how can I be sure that the profiles returned here are
compatible with the JDBCConnectionFactory class?
> Something like this will get you a list of database-related profiles:
> IConnectionProfile[] databaseProfiles =
>
ProfileManager.getProfilesByCategory("org.eclipse.datatools.connectivity.db.category ");
> From there, I'd take a look at the
> org.eclipse.datatools.connectivity.drivers.jdbc.JDBCConnecti on class and
> specifically it's createConnection (ClassLoader) method. You won't
> necessarily need the classloader aspects of it, but it shows how to get the
> various details out of a db profile needed to make a JDBC connection.
it seems to me that your package reference is wrong.. I can only find a
JDBCConnection class in the org.eclipse.datatools.connectivity.db.generic
package. That class is marked as NON-API, however..
thanks,
Christian
|
|
|
Re: access DTP connection profiles [message #589893 is a reply to message #41369] |
Thu, 07 February 2008 17:49 |
Brian Fitzpatrick Messages: 500 Registered: July 2009 |
Senior Member |
|
|
Everything in the Database category SHOULD conform to the
JDBCConnectionFactory class and everything should extend that. If you want
DTP to simply hand you a JDBC connection, you can get a profile and then
call:
myprofile.createConnection("java.sql.Connection");
which will give you an IConnection. Once you have the connection, you can
get the raw connection and see if that's a java.sql.Connection and just use
the connection itself.
The JDBCConnection class I'm looking at is in the
org.eclipse.datatools.connectivity.drivers.jdbc package of the
org.eclipse.datatools.connectivity plug-in. The one in the Generic JDBC
plug-in extends that.
--Fitz
"Christian Sell" <c.sell@NOSPAM.byterefinery.de> wrote in message
news:1509284840dc37253b4ea77c3c758bd4$1@www.eclipse.org...
> Hello Brian,
>
>> You bet. This sounds like a cool tool. :)
>
> yes, I thought I'd create something reaally unique ;)
>
>> As for how to get at the profile metadata, if you have DTP installed, you
>> have a plug-in called org.eclipse.datatools.connectivity. This has a
>> class in it called org.eclipse.datatools.connectivity.ProfileManager.
>> From here, you can get a list of existing connection profiles and then
>> start fiddling with their metadata.
>
> ot that. However, how can I be sure that the profiles returned here are
> compatible with the JDBCConnectionFactory class?
>
>> Something like this will get you a list of database-related profiles:
>
>> IConnectionProfile[] databaseProfiles =
> ProfileManager.getProfilesByCategory("org.eclipse.datatools.connectivity.db.category ");
>> From there, I'd take a look at the
>> org.eclipse.datatools.connectivity.drivers.jdbc.JDBCConnecti on class and
>> specifically it's createConnection (ClassLoader) method. You won't
>> necessarily need the classloader aspects of it, but it shows how to get
>> the various details out of a db profile needed to make a JDBC connection.
>
> it seems to me that your package reference is wrong.. I can only find a
> JDBCConnection class in the org.eclipse.datatools.connectivity.db.generic
> package. That class is marked as NON-API, however..
>
> thanks,
> Christian
>
>
>
|
|
| | |
Goto Forum:
Current Time: Sat Apr 27 01:21:32 GMT 2024
Powered by FUDForum. Page generated in 0.03678 seconds
|