Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DTP » Retrieve port and host from IConnectionProfile
Retrieve port and host from IConnectionProfile [message #52891] Tue, 03 March 2009 16:41 Go to next message
Eclipse UserFriend
Originally posted by: andi.hotz.adsl.li

Hello
I figured out a great deal of how DTP works with the help from this
newsgroup or on my own. Thanks.
There is still a question I can't find an answer. Based on an
IConnectionProfile I can retrieve the connection URL through
getBaseProperties(). For some databases this connection string contains
the a port number and a host. The connection URL is part of the
properties defined with the database connection. The exact format of the
connection URL varies with the vendors (i.e. MySQL vs. Oracle). What I
need in my application is the port number and the host name. Is there a
way to retrieve these from a IConnectionProfile or must I write a vendor
specific parser for the connection string?

Cheers

Andy
Re: Retrieve port and host from IConnectionProfile [message #53152 is a reply to message #52891] Thu, 05 March 2009 14:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: brianf.sybase.com

Hi Andy!

Unfortunately, because of the way JDBC works and the variations of the JDBC
URL, there isn't a great way to figure out the host and port without having
some prior knowledge of what database system you're going after.

Sorry... I wish I could help more.

The various sample URLs for the vendors are listed in the driver template
definitions in DTP's enablement projects, so if you do a search for
"driverTemplate" in plugin.xml in the Enablement projects. You can at least
that way get an example of the various styles/forms of URLs for the DBMS's
that DTP handles.

Good luck! Glad the info in the community has helped thus far!
--Fitz

"Andi Hotz" <andi.hotz@adsl.li> wrote in message
news:gojmjh$52q$1@build.eclipse.org...
> Hello
> I figured out a great deal of how DTP works with the help from this
> newsgroup or on my own. Thanks.
> There is still a question I can't find an answer. Based on an
> IConnectionProfile I can retrieve the connection URL through
> getBaseProperties(). For some databases this connection string contains
> the a port number and a host. The connection URL is part of the properties
> defined with the database connection. The exact format of the connection
> URL varies with the vendors (i.e. MySQL vs. Oracle). What I need in my
> application is the port number and the host name. Is there a way to
> retrieve these from a IConnectionProfile or must I write a vendor specific
> parser for the connection string?
>
> Cheers
>
> Andy
Re: Retrieve port and host from IConnectionProfile [message #53399 is a reply to message #53152] Wed, 11 March 2009 17:00 Go to previous message
Eclipse UserFriend
Originally posted by: andi.hotz.adsl.li

Thanks Brian

It was not the answer I hoped for but anyway....
I implemented a parser for the connection URLs. For anyone who is in the
same need, the parser can be found at
http://codegenjava.svn.sourceforge.net/viewvc/codegenjava/tr unk/ch.sahits.codegen.java.datatools/src/ch/sahits/codegen/u til/DTPConnectionParser.java
The JUnit for the class is at
http://codegenjava.svn.sourceforge.net/viewvc/codegenjava/tr unk/ch.sahits.codegen.test/src/ch/sahits/codegen/java/util/D TPConnectionParserTest.java.

Cheers Andy

Brian Fitzpatrick wrote:
> Hi Andy!
>
> Unfortunately, because of the way JDBC works and the variations of the JDBC
> URL, there isn't a great way to figure out the host and port without having
> some prior knowledge of what database system you're going after.
>
> Sorry... I wish I could help more.
>
> The various sample URLs for the vendors are listed in the driver template
> definitions in DTP's enablement projects, so if you do a search for
> "driverTemplate" in plugin.xml in the Enablement projects. You can at least
> that way get an example of the various styles/forms of URLs for the DBMS's
> that DTP handles.
>
> Good luck! Glad the info in the community has helped thus far!
> --Fitz
>
> "Andi Hotz" <andi.hotz@adsl.li> wrote in message
> news:gojmjh$52q$1@build.eclipse.org...
>> Hello
>> I figured out a great deal of how DTP works with the help from this
>> newsgroup or on my own. Thanks.
>> There is still a question I can't find an answer. Based on an
>> IConnectionProfile I can retrieve the connection URL through
>> getBaseProperties(). For some databases this connection string contains
>> the a port number and a host. The connection URL is part of the properties
>> defined with the database connection. The exact format of the connection
>> URL varies with the vendors (i.e. MySQL vs. Oracle). What I need in my
>> application is the port number and the host name. Is there a way to
>> retrieve these from a IConnectionProfile or must I write a vendor specific
>> parser for the connection string?
>>
>> Cheers
>>
>> Andy
>
>
Re: Retrieve port and host from IConnectionProfile [message #594516 is a reply to message #52891] Thu, 05 March 2009 14:47 Go to previous message
Brian Fitzpatrick is currently offline Brian FitzpatrickFriend
Messages: 500
Registered: July 2009
Senior Member
Hi Andy!

Unfortunately, because of the way JDBC works and the variations of the JDBC
URL, there isn't a great way to figure out the host and port without having
some prior knowledge of what database system you're going after.

Sorry... I wish I could help more.

The various sample URLs for the vendors are listed in the driver template
definitions in DTP's enablement projects, so if you do a search for
"driverTemplate" in plugin.xml in the Enablement projects. You can at least
that way get an example of the various styles/forms of URLs for the DBMS's
that DTP handles.

Good luck! Glad the info in the community has helped thus far!
--Fitz

"Andi Hotz" <andi.hotz@adsl.li> wrote in message
news:gojmjh$52q$1@build.eclipse.org...
> Hello
> I figured out a great deal of how DTP works with the help from this
> newsgroup or on my own. Thanks.
> There is still a question I can't find an answer. Based on an
> IConnectionProfile I can retrieve the connection URL through
> getBaseProperties(). For some databases this connection string contains
> the a port number and a host. The connection URL is part of the properties
> defined with the database connection. The exact format of the connection
> URL varies with the vendors (i.e. MySQL vs. Oracle). What I need in my
> application is the port number and the host name. Is there a way to
> retrieve these from a IConnectionProfile or must I write a vendor specific
> parser for the connection string?
>
> Cheers
>
> Andy
Re: Retrieve port and host from IConnectionProfile [message #594619 is a reply to message #53152] Wed, 11 March 2009 17:00 Go to previous message
Eclipse UserFriend
Originally posted by: andi.hotz.adsl.li

Thanks Brian

It was not the answer I hoped for but anyway....
I implemented a parser for the connection URLs. For anyone who is in the
same need, the parser can be found at
http://codegenjava.svn.sourceforge.net/viewvc/codegenjava/tr unk/ch.sahits.codegen.java.datatools/src/ch/sahits/codegen/u til/DTPConnectionParser.java
The JUnit for the class is at
http://codegenjava.svn.sourceforge.net/viewvc/codegenjava/tr unk/ch.sahits.codegen.test/src/ch/sahits/codegen/java/util/D TPConnectionParserTest.java

Cheers Andy

Brian Fitzpatrick wrote:
> Hi Andy!
>
> Unfortunately, because of the way JDBC works and the variations of the JDBC
> URL, there isn't a great way to figure out the host and port without having
> some prior knowledge of what database system you're going after.
>
> Sorry... I wish I could help more.
>
> The various sample URLs for the vendors are listed in the driver template
> definitions in DTP's enablement projects, so if you do a search for
> "driverTemplate" in plugin.xml in the Enablement projects. You can at least
> that way get an example of the various styles/forms of URLs for the DBMS's
> that DTP handles.
>
> Good luck! Glad the info in the community has helped thus far!
> --Fitz
>
> "Andi Hotz" <andi.hotz@adsl.li> wrote in message
> news:gojmjh$52q$1@build.eclipse.org...
>> Hello
>> I figured out a great deal of how DTP works with the help from this
>> newsgroup or on my own. Thanks.
>> There is still a question I can't find an answer. Based on an
>> IConnectionProfile I can retrieve the connection URL through
>> getBaseProperties(). For some databases this connection string contains
>> the a port number and a host. The connection URL is part of the properties
>> defined with the database connection. The exact format of the connection
>> URL varies with the vendors (i.e. MySQL vs. Oracle). What I need in my
>> application is the port number and the host name. Is there a way to
>> retrieve these from a IConnectionProfile or must I write a vendor specific
>> parser for the connection string?
>>
>> Cheers
>>
>> Andy
>
>
Previous Topic:No repository found - Cannot install any new feature in Eclipse
Next Topic:Reverse engineer DBSchema to XSD
Goto Forum:
  


Current Time: Tue Mar 19 11:53:05 GMT 2024

Powered by FUDForum. Page generated in 0.01558 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top