Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 180356

Summary: DataSource Explorer doesn't show Schema
Product: [Tools] Data Tools Reporter: Michael Woski <woskimi>
Component: Data Source ExplorerAssignee: Project Inbox <dtp.enablement-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: m.hoffmann, rodrigoaraujoeti
Version: 1.5Keywords: helpwanted
Target Milestone: 1.6   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
View of Data Source Explorer none

Description Michael Woski CLA 2007-03-31 12:31:31 EDT
Build ID: M6

Steps To Reproduce:
1.Create a new Connection Profile (SQL Model) in the DataSource Explorer and connect to the Database. Everything's fine, you can browse the Schema.
2. Relaunch Eclipse
3. Connecting to the database works, but the Schema can't be 
displayed anymore.

More information:
The following error appears when connecting to the database:

Error creating SQL Model Connection connection to test2. (Error: null)

java.lang.NullPointerException
	at org.eclipse.datatools.connectivity.sqm.internal.core.util.DatabaseProviderHelper.getCatalogDatabase(DatabaseProviderHelper.java:37)
	at org.eclipse.datatools.connectivity.sqm.internal.core.util.DatabaseProviderHelper.setDatabase(DatabaseProviderHelper.java:46)
	at org.eclipse.datatools.connectivity.sqm.internal.core.connection.ConnectionInfoImpl.<init>(ConnectionInfoImpl.java:628)
	at org.eclipse.datatools.connectivity.sqm.internal.core.connection.ConnectionFactory.createConnection(ConnectionFactory.java:36)
	at org.eclipse.datatools.connectivity.sqm.core.SQMConnectionFactory.createConnection(SQMConnectionFactory.java:45)
	at org.eclipse.datatools.connectivity.internal.ConnectionFactoryAdapterProvider.createConnection(ConnectionFactoryAdapterProvider.java:79)
	at org.eclipse.datatools.connectivity.internal.CreateConnectionJob.run(CreateConnectionJob.java:55)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
Comment 1 John Graham CLA 2007-04-09 11:26:06 EDT
Michael:

I tried this in the DTP 1.5 4/9 and couldn't repro. Connected to PostgreSQL 8.1.2, DSE tree OK, close connection, relaunch Eclipse, connect, and everything's still fine. Next, tried connecting to PostgreSQL 8.1.2, DSE tree OK, close Eclipse without closing connection, relaunch, connect, DSE tree still OK.

Could you provide some more details about the DB that you are connecting to, your OS, and so on?

Thanks
Comment 2 Rob Cernich CLA 2007-04-09 12:53:56 EDT
Hey John,

My guess is that this is a problem with the way the connection profile is configured.  If an extender fails to include the database vendor and version properties, the ConnectionInfoImpl can't find the DB definition, which is probably what is causing this error.  Not sure why it works once.  Just a guess.

Rob
Comment 3 Michael Woski CLA 2007-04-09 13:13:09 EDT
Hi John,

I'm using a MySQL 5.1 database. I tried both the recent 3.1.14 and 5.0.5 JDBC connectors with the standard Driver class. It's all the same, I even tried a fresh workspace just to be sure.. The Drivers are configured under MySQL 4.1 (whatever that 4.1 means) in the Connectivity Preferences.
When the problem shows and I change the driver from the drop down list in the JDBC Connection Properties (Data Source Explorer -> Database -> Properties) everything's fine again (including connecting/disconnecting/reconnecting) - until the next restart of Eclipse.

The other thing I should also mention is, I'm using the M6 Eclipse build on Linux/GTK2(x86_64).
Comment 4 Michael Woski CLA 2007-04-14 13:04:29 EDT
Hi John,

there's news here. I tried the same thing with a PostgreSQL database and it worked like a charm, as long as the new Connection Profile had been chosen from the "PostgreSQL JDBC Connection". However, as soon as you create a new connection from an "SQL Model JDBC Connection", either to a MySQL or a PostgreSQL database, things mess up like previously mentioned; note, it does so with every(!) profile, even those that used to work before the addition of the "SQL Model JDBC Connection".
Deleting the latter does not solve the problem with the other profiles though, in the sequel they still show that corrupted behaviour.

Hope I could help
Comment 5 John Graham CLA 2007-05-10 13:27:29 EDT
Michael:

When DTP 1.5RC0 is available (target: 5/11), please retest this for MySQL. I saw the same problems, but they appear to be fixed with the recent updates of the MySQL driver templates and db definition files.
Comment 6 Michael Woski CLA 2007-05-14 01:33:59 EDT
(In reply to comment #5)

Hallo John,

unfortunately RC0 didn't fix things, however, it changed them.
Despite showing only the catalog given in the URL of the connection profile, one can actually see all those that are available in the database. For each of those catalogs the next thing to see is the "Schemas" folder, but with nothing in it.
Also, no exceptions are thrown anymore.
It still applies that when the connection profile is new it works just fine, until you restart eclipse.
Comment 7 Rob Cernich CLA 2007-05-15 11:26:11 EDT
Hey Michael,

Could you please provide a set of detailed steps to reproduce this problem?

Thanks in advance,
Rob
Comment 8 Michael Woski CLA 2007-05-15 12:49:06 EDT
Hey Rob,

it's quite simple. I create a new Connection Profile, one time with a MySQL server and the other time I do the exact same thing with a PostgreSQL server. In the latter case everything works as you would expect, in the first case it does so too but only as long as you don't close and reopen eclipse. It really is just an issue with MySQL, or let's say it doesn't happen with PostgreSQL.
To clearify what the problem looks like on the screen I'll attach a little file.

bye M;chi
Comment 9 Michael Woski CLA 2007-05-15 12:53:26 EDT
Created attachment 67274 [details]
View of Data Source Explorer

for the first connection the "amarok" schema had been specified in the connection URL, but instead I get a complete list with nothing in it though.
For postgres it just works, as you can see
Comment 10 John Graham CLA 2007-06-14 17:58:17 EDT
Will continue to look at this post 1.5. Might need Enablement support for MySQL...
Comment 11 Mark Hoffmann CLA 2007-12-05 07:50:32 EST
(In reply to comment #10)
Hello,
I encountered this problem too with MySQL. The problem always appears if i have unchecked save password in the connection profile. So I have to click to connect, give the password and after that I see the connection described before with catalog and schema but no tables. Editing the connection profile doesn't help in my case, so I have to recreate the profile and check save password and everything is fine.

Mark

Comment 12 Brian Fitzpatrick CLA 2008-07-02 13:44:01 EDT
Is this still an issue with Ganymede?
Comment 13 Michael Woski CLA 2008-07-03 04:15:56 EDT
(In reply to comment #12)
> Is this still an issue with Ganymede?
Hi,
it now works properly, at least for me.

thx for all the effort
Comment 14 Brian Fitzpatrick CLA 2008-07-03 19:12:57 EDT
NP. Resolving as fixed.
Comment 15 Brian Fitzpatrick CLA 2008-07-03 19:13:29 EDT
Closing bug
Comment 16 rodrigo araujo CLA 2013-07-12 16:18:42 EDT
Im using db2. In localhost it works fine, but remote don't.