Adding mysql data from a java script - Problem with JDBC Drivers [message #1732482] |
Tue, 17 May 2016 15:04 |
Antoniol Matthieu Messages: 1 Registered: May 2016 |
Junior Member |
|
|
Hello!
I'm trying at the moment to make a reporting tool and to automate it.
The first step of automatisation was to create it in the designer so that i know what it looks like.
To test my assumptions, I built a sample Data Base with WAMP on my PC.
In the BIRT designer, I managed to connect the Database and to create nice graphics based on a combination of sql queries and BIRT system of aggregation.
Now let's go to the problematic part. I used this driver:
com.mysql.jdbc.Driver (v5.1)
It worked perfectly in the designer. I'm trying to use it from a Java script.
String nameDriver = "com.mysql.jdbc.Driver (v5.1)";
String urlBase = "jdbc:mysql://localhost/HPISIMPLE";
String loginBase = "loginbase";
String passBase = "mdpbase";
String DataName = "simplebase";
// création d'un élément source de données de type jdbc
OdaDataSourceHandle dsHandle = factory.newOdaDataSource(DataName,"org.eclipse.birt.report.data.oda.jdbc");
// customisation de l'élément
dsHandle.setProperty("odaDriverClass", nameDriver);
dsHandle.setProperty("odaURL", urlBase);
dsHandle.setProperty("odaUser", loginBase);
dsHandle.setProperty("odaPassword", passBase);
String nomDuDataSetPrincipal = "DataSetPrincipal";
String requetePrincipal = "Ma requête SQL.... ";
OdaDataSetHandle odaDataSetHandlePrincipal = factory.newOdaDataSet(nomDuDataSetPrincipal,"org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet");
à la fin de la génération de mon rptdesign, si je l'ouvre avec le designer, Quand j'essaie d'aller voir si les données ont été acquise, je me rend compte que la Data Source est bien paramétrée, Mais que le designer ne reconnait le driver "com.mysql.jdbc.Driver (v5.1)", ce qui est drôle c'est qu'il me le propose dans la liste déroulante des drivers. Je pense que lors de la création du rptdesign via mon script java je n'inclue pas le bon driver. Dans le projet j'ai tenté de mettre les différentes librairies et le jar correspondant mais rien y fait! Si quelqu'un à des idées de lignes que je pourrait rajouter afin d'inclure le .jar lors de l'éxécution java je vous en serai reconnaissant.
Encore merci
Matthieu
|
|
|
Powered by
FUDForum. Page generated in 0.13155 seconds