Pentaho

 View Only
  • 1.  Getting an Error when creating DatabaseMeta Object on MySQL

    Posted 26 days ago

    Actually I am trying to create a database meta object from pentaho-metadata maven repo for mysql database. When I was trying that I am getting this error - 

    Exception in thread "main" java.lang.RuntimeException: Database type not found!
     at org.pentaho.di.core.database.DatabaseMeta.setValues(DatabaseMeta.java:642)
     at org.pentaho.di.core.database.DatabaseMeta.<init>(DatabaseMeta.java:507)
     at com.translate.demo.App.main(App.java:63)
    Caused by: org.pentaho.di.core.exception.KettleDatabaseException:
    database type with plugin id [MySQL] couldn't be found!


     at org.pentaho.di.core.database.DatabaseMeta.findDatabaseInterface(DatabaseMeta.java:592)
     at org.pentaho.di.core.database.DatabaseMeta.getDatabaseInterface(DatabaseMeta.java:566)
     at org.pentaho.di.core.database.DatabaseMeta.setValues(DatabaseMeta.java:640)
     ... 2 more

     Code Snippet

    DatabaseMeta meta = new DatabaseMeta("db", "MySQL", "Native" , "localhost", "db", "3306", "username", "password");



    ------------------------------
    Surojeet Ghosh
    BMC Software
    ------------------------------


  • 2.  RE: Getting an Error when creating DatabaseMeta Object on MySQL

    Posted 18 days ago

    Hi,

    metadata ID is "MYSQL", not "MySQL".



    ------------------------------
    P.V.A. systems s.r.o.
    ------------------------------



  • 3.  RE: Getting an Error when creating DatabaseMeta Object on MySQL

    Posted 5 days ago

    Thanks for the answer

    Actually I am still getting the same answer even after changing the database type. Below is the code snippet where I am using above statement. Basically what I am trying to do is generate a domain using view sql and then try to generate a mql query using databasemeta object.

    public static Query queryObject;

    public static IMetadataDomainRepository repo = new InMemoryMetadataDomainRepository();

    public static SqlGenerator gen = new SqlGenerator();

    /// Below snippet

    createDomain(query);

    LogicalModel logModel = domain.getLogicalModels().get(0);

    Query query = new Query(domain, logModel);

    repo.storeDomain(domain, false);

    DatabaseMeta meta = new DatabaseMeta("db", "MYSQL", "Native" , "localhost", "db", "3306", "root", "tiger");

    MappedQuery mQuery = gen.generateSql(query, "en_US", repo, meta);



    ------------------------------
    BMC Software
    ------------------------------



  • 4.  RE: Getting an Error when creating DatabaseMeta Object on MySQL

    Posted 2 days ago

    And error message exactly is?



    ------------------------------
    P.V.A. systems s.r.o.
    ------------------------------