How can I use "connection" in my own operator

21310122
21310122 New Altair Community Member
edited November 5 in Community Q&A

I want to use the connection that have been configured before in my operator.

I created a operator and want to read data from my own database.

 

But how do I make the value of this parameter match the configured real connection?

Just like the "read database" operator does:

I select a connection from the drop-down box and then use this connection in the operator to read the information from the database?

 

I read document "How to extend RapidMiner" and referenced the contents of Chapter 9.

doc.png

 

Indeed connection configuration dialog have been created and the connection parameter also appears in the operator.

dialog.png

parameter.png

 

But what I get in code is something like this: 

typejdbc.jpg

 

@mborbely 

I do set the url,username and password in configuration dialog, but How can I get value of these parameters in code?

And is there any document about this?

Thanks a lot!

 

 

Tagged:

Answers

  • sgenzer
    sgenzer
    Altair Employee

    tagging @mschmitz

     

     

  • mborbely
    mborbely New Altair Community Member

    Hi,

     

    Unfortunately the classes that provide support for obtaining a connection defined in "Manage Database Connections" (and would also help you create the parameter definition) are defined in the jdbc extension, which is not publicly accessible. You could obtain this jar from you RM home folder, but I'm not sure RapidMiner EULA allows you to compile against it. Instead you'll probably have to implement your own connection definition mechanism from scratch.

     

    Cheers,

    Máté

  • 21310122
    21310122 New Altair Community Member

    I know that the code isn't open for developer, so I didn't use this kind of ways to get connection at first.

    But when I use RM's "Manage Database Connections" dialog, it didn't work well.

    https://community.rapidminer.com/t5/RapidMiner-Studio-Forum/quot-Enabling-Autocommit-Is-Not-Supported-quot-Error-Connecting/m-p/51301#M32242

     

    Regardless of this, let's say I have configured the connection using your configuration dialog.

    So how do I use this connection in my own operator? I don't need all of your code, I just want to know what class I need to inherit or which method to implement, to match the connection parameter in the operator with the previously configured connection and to read the properties.

    Don't you support developing my own operator to get the connection information and to read database?

     

    Suppose my needs are like this:

    when reading database information, I also need to call the code of my own project to enhance the authority verification information. For example, my custom database connection and address are not real and cannot be directly connected or read. The parameters need to be further parsed and only users with certain permissions can read the information of this database.

     

    Under this demand, I have to do my own read database operator development, isn't it?
    So what should I do in this scenario? I can't simply use radoop, right? So this is back to the original question:

    I don't need all of your code, I just want to know what class I need to inherit or which method to implement, to match the connection parameter in the operator with the previously configured connection and to read the properties.

    Is there any document or code example?

     

    In your documentation "How to extend RapidMiner", only tell developer how to develop a custom configuration dialog and let the parameters appear on the parameter page of the custom operator, but did not say how to use this connection as a real connection then it can read the database.

     

    I really need your help, sincere thanks.

     @mborbely