Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

Create a connecion with jdbc Mysql :

By : mhallam@talend.com

Make your login and password to access to database.

JAR file :

If you are using TDQ :

TDQ_EE_MPX-All-r31371-V3.2.1\plugins\org.talend.libraries.jdbc.mysql_3.2.1.r31371\lib

You will find driver .jar

URL:

jdbc:mysql://localhost:3306/dbName?zeroDateTimeBehavior=convertToNull&noDatetimeS
tringSync=true&characterEncoding=UTF-8
Create a connecion with jdbc hsql :
Download the database at :

http://sourceforge.net/projects/hsqldb/files/alpha_beta/hsqldb_1_9_0_rc6/hsqldb-1.9.0-
rc6.zip/download

Run the database

the Swing version of the Database Manager is executed. The hsqldb.jar is located in the
directory../lib relative to the current directory.

HSQL exist also on TDQ or TOP see in lib folder hsqldb.jar .

java -cp ../lib/hsqldb.jar org.hsqldb.util.DatabaseManagerSwing

If hsqldb.jar is in the current directory, the command would change to:

java -cp hsqldb.jar org.hsqldb.util.DatabaseManagerSwing

You will see:


SERVER MODE:

Lounch your wizard of connection hsql

Go to TOP and try to connect:

The driver can be found on hsql folder ->lib


In this case, the connection is false TOP doesn’t react when we click on finish and no error
message is shown.

If we try to see log file:

Results: Unhandled event loop exception

Log :

java.lang.NoSuchMethodError:
org.hsqldb.DatabaseURL.parseURL(Ljava/lang/String;ZZ)Lorg/hsqldb/persist/HsqlProperties;
at org.hsqldb.jdbc.JDBCDriver.getConnection(JDBCDriver.java:267)
at org.hsqldb.jdbc.JDBCDriver.connect(JDBCDriver.java:245)
at org.talend.cwm.db.connection.ConnectionUtils.createConnectionWithTimeout(Unknown Source)
at org.talend.dataprofiler.core.ui.wizard.database.DatabaseWizardPage.checkDBConnection(Unknown Source)
at org.talend.dataprofiler.core.ui.wizard.database.DatabaseWizardPage.access$6(Unknown Source)
at org.talend.dataprofiler.core.ui.wizard.database.DatabaseWizardPage$5.widgetSelected(Unknown Source)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at org.talend.dataprofiler.core.ui.action.actions.CreateConnectionAction.run(Unknown Source)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:583)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:500)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.talend.dataprofiler.rcp.intro.Application.start(Unknown Source)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
Standalone MODE:

Lounch your wizard of connection hsql

Same thing like before, Unhandled event loop exception and no reaction from TOP when we
try click on finish.
Log:

java.lang.NoSuchMethodError: org.hsqldb.DatabaseURL.parseURL(Ljava/lang/String;ZZ)Lorg/hsqldb/persist/HsqlProperties;
at org.hsqldb.jdbc.JDBCDriver.getConnection(JDBCDriver.java:267)
at org.hsqldb.jdbc.JDBCDriver.connect(JDBCDriver.java:245)
at org.talend.cwm.db.connection.ConnectionUtils.createConnectionWithTimeout(Unknown Source)
at org.talend.dataprofiler.core.ui.wizard.database.DatabaseWizardPage.checkDBConnection(Unknown Source)
at org.talend.dataprofiler.core.ui.wizard.database.DatabaseWizardPage.access$6(Unknown Source)
at org.talend.dataprofiler.core.ui.wizard.database.DatabaseWizardPage$5.widgetSelected(Unknown Source)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at org.talend.dataprofiler.core.ui.action.actions.CreateConnectionAction.run(Unknown Source)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:583)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:500)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.talend.dataprofiler.rcp.intro.Application.start(Unknown Source)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)

And if we try with the following connection (choose other driver listed by TOP)
The connection will be successful and we get bug N°1.

Correct ways to connect hsql database:


All the following screenshots are correct to create connections
All this three ways to connect hsql are correct and we can so create our HSQL database.

The file of tbi is stored under folder lib in hsql folder.

So now we can try to connect from TOP and analyze our data, here is the screenshot for connection:

For all three connection listed before we can connect only with url « mem »

BUG:
It seems like SQL server 2008 bugs, but here the confusion is between scheme and database.
Another bug when we try to create another hsql database despite names
are different (on TDQ ):
2009-11-10 13:57:27,734 ERROR org.talend.cwm.db.connection.TalendCwmFactory - Could
not retrieve the database structure

An exception stack trace is not available.

java.lang.NullPointerException
at org.talend.cwm.helper.CatalogHelper.addSchemas(Unknown Source)
at org.talend.cwm.builders.CatalogBuilder.initializeSchemaLow(Unknown Source)
at org.talend.cwm.builders.CatalogBuilder.initializeSchema(Unknown Source)
at org.talend.cwm.builders.CatalogBuilder.getSchemata(Unknown Source)
at org.talend.cwm.db.connection.DBConnect.retrieveDatabaseStructure(Unknown
Source)
at org.talend.cwm.db.connection.TalendCwmFactory.getCatalogs(Unknown Source)
at org.talend.cwm.db.connection.TalendCwmFactory.createDataProvider(Unknown
Source)
at org.talend.dq.connection.DataProviderBuilder.initializeDataProvider(Unknown
Source)
at
org.talend.dataprofiler.core.ui.wizard.database.DatabaseConnectionWizard.initCWMResour
ceBuilder(Unknown Source)
at org.talend.dataprofiler.core.ui.wizard.AbstractWizard.performFinish(Unknown
Source)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:742)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:373)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at
org.talend.dataprofiler.core.ui.action.actions.CreateConnectionAction.run(Unknown Source)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionI
tem.java:583)
at
org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:500)
at
org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java
:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.talend.rcp.intro.Application.start(Unknown Source)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLa
uncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.jav
a:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)

Here is some script to create a table on HSQL quickly:

CREATE TABLE company (company_id integer ,company_name varchar(10)) ;

INSERT INTO company (company_id,company_name) values (1,'informatica') ;

INSERT INTO company (company_id,company_name) values (2,'talend') ;


Create a connecion with jdbc DERBY :
1)Download derby database (last version):
http://db.apache.org/derby/derby_downloads.html

2)To create and install a derby database follow instructions on:

http://db.apache.org/derby/papers/DerbyTut/install_software.html#derby_install

3) Talend doesn’t support connection without authentification so to create a user and


password for the database .

you must open properties file of the database ( in db-derby-10.5.3.0-bin folder->bin-


>yourDataBase )

Go to TDQ or TOP and create a new connecion

See the screenshot


There are 5 pilotes listed by talend , I tried all , but the appropriate one is : embedded jar

Problem: Talend can’t find the database.

You might also like