Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DTP » Still can't create a connection
Still can't create a connection [message #594955] Thu, 02 April 2009 21:38
Mark Leone is currently offline Mark LeoneFriend
Messages: 123
Registered: July 2009
Senior Member
I've been trying for three weeks, and I can't figure out to
programmatically access a JDBC connection with DTP. My objective is to
provide a plugin that wraps a JDBC connection, so that other plugins can
create DB connections without having to know the physical location of the
jar file, the driver class, etc.

The approach I'm currently working on is to declare a driverExtension
extension, which uses a driverOverride element to override the URL and
dtabase name properties for the MySQL driver template included in the
enablement plugin. Then I call ProfileManager.createProfile(), giving it
an arbitrary name, description, and provider ID, as well as a Properties
object that has the username, password and driver template ID (the ID of
the driver template that I overrode).

I can call methods on the profile created in this way, and when I call
aerPropertiesComplete() it returns true. However, when I try to call
createConnection() on the profile, I get a Null Pointer Exception. Looking
in the DTP source code, there's only a single line in that method, and it
is

return mProvider.getConnectionFactory(factoryId).createConnection(t his);

I suspect it's the mProvider object that is null, because I provided an
arbitrary name for the provider parameter when I called
ConnectionProfileManager.createConnection(). I didn't think that was
right, but I couldn't find anything that tells how to specify the
provider, or if that's supposed to connect to the profile somehow.

Maybe the provider is the missing link, or maybe I got something else
wrong. Can someone please tell me what I have wrong and how I can access a
connection?

-Mark
Previous Topic:Specifying the default schema for code completion
Next Topic:Specifying the default schema for code completion
Goto Forum:
  


Current Time: Fri Mar 29 11:06:47 GMT 2024

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

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

Back to the top