[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.dtp] Error while trying to get tables from a MySQL database

Hi.

I encountered an error while trying to get the tables from a MySQL database. More precisely, when I select the "Tables" folder of my MySQL connection in the Data Source Explorer.

I created a MySQL profile connection, and I tested it with two versions of a MySQL JDBC driver (mysql-connector-5.0.8 and 5.1.7). I got the same error in the two cases. The database I'm using for tests was also used with Talend (so, I know the problem is not on the database - and Talend is not running at the same time).

I assume the error could be in the way I defined my connection (I don't think it is a bug - I checked the DTP bugzilla and did not find it).

The exception I got is:

java.sql.SQLException: An exception occurred invoking java.sql.DatabaseMetaData.getTables().
	at org.eclipse.datatools.enablement.mysql.catalog.loaders.MySqlTableLoader.createResultSet(MySqlTableLoader.java:155)
	at org.eclipse.datatools.enablement.mysql.catalog.loaders.MySqlTableLoader.loadTables(MySqlTableLoader.java:82)
	at org.eclipse.datatools.connectivity.sqm.core.rte.jdbc.JDBCSchema.loadTables(JDBCSchema.java:128)
	at org.eclipse.datatools.connectivity.sqm.core.rte.jdbc.JDBCSchema.getTables(JDBCSchema.java:89)
	at org.eclipse.datatools.modelbase.sql.schema.impl.SchemaImpl.eGet(SchemaImpl.java:597)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1013)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1005)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1000)
	at org.eclipse.datatools.connectivity.sqm.server.internal.ui.explorer.providers.content.layout.vnode.ServerExplorerVNodeContentProviderNav.getSchemaChildren(ServerExplorerVNodeContentProviderNav.java:250)
	at org.eclipse.datatools.connectivity.sqm.server.internal.ui.explorer.providers.content.layout.vnode.ServerExplorerVNodeContentProviderNav.displayTableNodeChildren(ServerExplorerVNodeContentProviderNav.java:187)
	at org.eclipse.datatools.connectivity.sqm.server.internal.ui.explorer.providers.content.layout.AbstractOnDemandContentProviderNav.getChildren(AbstractOnDemandContentProviderNav.java:173)
	at org.eclipse.datatools.connectivity.sqm.server.internal.ui.explorer.providers.content.layout.AbstractOnDemandContentProviderNav.getChildren(AbstractOnDemandContentProviderNav.java:243)
	at org.eclipse.datatools.connectivity.sqm.server.internal.ui.explorer.providers.content.layout.AbstractLayoutProviderNav.getChildren(AbstractLayoutProviderNav.java:85)
	at org.eclipse.datatools.connectivity.sqm.server.internal.ui.explorer.providers.content.impl.ServerExplorerContentProviderNav.load(ServerExplorerContentProviderNav.java:153)
	at org.eclipse.datatools.connectivity.sqm.server.internal.ui.explorer.loading.LoadingJob.run(LoadingJob.java:43)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.lang.NullPointerException
	at org.eclipse.datatools.enablement.mysql.catalog.loaders.MySqlTableLoader.createResultSet(MySqlTableLoader.java:145)
	... 15 more



I put some breakpoints and I found that the exception occurs in MySqlTableLoader, in the following lines:


String catalogName = getCatalogObject().getConnection().getCatalog();
if(catalogName == null || catalogName.trim().length() == 0){
	getCatalogObject().getConnection().setCatalog(getSchema().getCatalog().getName());
}


More exactly, the "getSchema().getCatalog()" returns "null" (catalogName = '').

Does anyone know why this error is thrown?
Are there some properties to define or limitations on the JDBC drivers we can use with DTP? I precise that this database and these drivers were working with DTP on Ganymede.



Regards,

          Vincent.


-- Vincent Zurczak EBM WebSourcing