//package org.gcube.dataanalysis.test; //import static org.gcube.resources.discovery.icclient.ICFactory.clientFor; //import static org.gcube.resources.discovery.icclient.ICFactory.queryFor; // //import java.io.BufferedReader; //import java.io.IOException; //import java.io.InputStreamReader; //import java.util.List; //import java.util.Scanner; // //import org.gcube.common.encryption.StringEncrypter; //import org.gcube.common.resources.gcore.ServiceEndpoint; //import org.gcube.common.scope.api.ScopeProvider; //import org.gcube.dataanalysis.databases.resources.DBResource; //import org.gcube.dataanalysis.ecoengine.configuration.AlgorithmConfiguration; //import org.gcube.resources.discovery.client.api.DiscoveryClient; //import org.gcube.resources.discovery.client.queries.impl.XQuery; //import org.hibernate.SessionFactory; // //public class TestApp { // // /** // * @param args // */ // public static void main(String[] args) { // // TODO Auto-generated method stub // // //// ScopeProvider.instance.set("/gcube/devsec/devVRE"); // ScopeProvider.instance.set("/gcube/devsec"); // // // // XQuery query = queryFor(ServiceEndpoint.class); // query.addCondition("$resource/Profile/Category/text() eq 'Database'"); // // DiscoveryClient prova=clientFor(DBResource.class); // List access = prova.submit(query); // // // System.out.println("size resource: "+access.size()); // // // // // // for(int i=0;i rawnames = df.executeQuery("select * from (select a.field1 as aa, b.field1_id as bb, b.field1 as cc from a7f768710_c7b0_11df_b2bc_e0f36cf4c8cd as a "+ ////// "left join cur_00d4e2d0_ecbd_11df_87fa_de008e0850ff as b on a.field3_id=b.field1_id) as cd", sf); //// //// /*List rawnames = df.executeQuery("select * from (select a.field1, b.field1_id, b.field1 from a7f768710_c7b0_11df_b2bc_e0f36cf4c8cd as a "+ //// "left join cur_00d4e2d0_ecbd_11df_87fa_de008e0850ff as b on a.field3_id=b.field1_id) as cd", sf);*/ //// ////// List rawnames = df.executeQuery("select a.field1 as aa, b.field1_id as bb, b.field1 as cc from a7f768710_c7b0_11df_b2bc_e0f36cf4c8cd as a "+ ////// "left join cur_00d4e2d0_ecbd_11df_87fa_de008e0850ff as b on a.field3_id=b.field1_id)", sf); //// //// //// //// //// //// //Query funzionante //// ////// List rawnames = df.executeQuery("select a.field1, b.field1_id from a7f768710_c7b0_11df_b2bc_e0f36cf4c8cd as a "+ ////// "left join cur_00d4e2d0_ecbd_11df_87fa_de008e0850ff as b on a.field3_id=b.field1_id", sf); //// //// //// //Query non funzionante ////// List rawnames = df.executeQuery("select a.field1, b.field1_id, b.field1 from a7f768710_c7b0_11df_b2bc_e0f36cf4c8cd as a "+ ////// "left join cur_00d4e2d0_ecbd_11df_87fa_de008e0850ff as b on a.field3_id=b.field1_id", sf); //// //// //Query funzionante con alias //// ////// List rawnames = df.executeQuery("select a.field1 as aa, b.field1_id as bb, b.field1 as cc from a7f768710_c7b0_11df_b2bc_e0f36cf4c8cd as a "+ ////// "left join cur_00d4e2d0_ecbd_11df_87fa_de008e0850ff as b on a.field3_id=b.field1_id", sf); //// //// //Query funzionante ////// List rawnames = df.executeQuery("select a.source_data as sourceA, b.source_data as sourceB, a.target_data_scientific_name as targetA, b.target_data_scientific_name as tagertB " + ////// "from bionymoutsimplefaked1csvpreprcsv as a join bionymoutfaked1csvpreprcsv as b on a.source_data=b.source_data limit 10",sf); //// //// List rawnames = df.executeQuery(q,sf); //// //// //// System.out.println("***************************************************************"); //// System.out.println(); //// //// System.out.println("Size: "+rawnames.size()); // // //// for (int i = 0; i < rawnames.size(); i++) { // // //// Object[] row = (Object[]) rawnames.get(i); // // //// for (int j = 0; j < row.length; j++) { // // //// System.out.print("\"" + row[j] + "\"; "); // // //// } //// System.out.println(); //// //System.out.println("Fine "); // // //// } //// //// //// //// } catch (Exception e) { //// // TODO Auto-generated catch block //// //e.printStackTrace(); //// //// System.out.println("***************************************************************"); //// System.out.println(); //// //// String error=e.getCause().toString(); //// //// if (error.contains("MySQLSyntaxErrorException")) //// { //// //// System.out.println("ERROR "+e.getMessage()+" "+"because an error is present: "+e.getCause().getMessage()); //// System.out.println("Suggestion: insert an alias name for the columns"); //// //// //// } //// //// //// } // // // //// }else { //// System.out.println("ERRORE: Non è possibile eseguire la connessione perchè l'indirizzo non è completo: databasename non dsiponibile"); //// }8 // // // //// } catch (IOException e1) { //// // TODO Auto-generated catch block //// e1.printStackTrace(); //// } // // // // // // // } //}