🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

"[SOLVED] Read Database operator(handler) in Java"

User: "Quick"
New Altair Community Member
Updated by Jocelyn
Hello,

I'm trying to write Java program using RapidMiner API.  In my program, operaters
are created, arranged, and connected as follows:

Operator generateData = OperatorService.createOperator(ExampleSetGenerator.class);
process.getRootOperator().getSubprocess(0).addOperator(generateData);
generateData.getOutputPorts().getPortByName("output").connectTo(process.getRootOperator().getInputPorts().getPortByName("result 1"));
As you know, The "Generate Data" operator is defined by ExampleSetGenerator class.

Here, I want to use "Read Database" operator(handler) to read datasets from
database.  I found DatabaseHandler class in com.rapidminer.tools.jdbc and guess
that it defines "Generate Data".  But it is not operator but handler so
OperatorService can't create it.


Does anyone know how to create (and configure) "Read Database" operator?
Any help would be appreciated.


Regards,

Find more posts tagged with

Sort by:
1 - 3 of 31
    User: "Marco_Boeck"
    New Altair Community Member
    Hi,

    I'll start with what I usually say:
    1) Please be aware that if you're using RM api that your program has to be licensed under the AGPL.
    2) Do you really need to create the process(es) manually? Usually it is a more efficient (and much less error prone) way to create the process(es) beforehand via the RM gui and then just use them (see here.
    3) If that is not an option, I'd recommend you have a look at the "OperatorsCore.xml" file which contains the links between operators and their classes.

    Regards,
    Marco
    User: "Quick"
    New Altair Community Member
    OP
    Thank you, Marco.

    I checked URLs you posted and followed these posts.  Now my program works.

    The only one point I stacked is that the repository path for the argument of RepositoryLocation() is not
    absolute path of process file but the location in RapidMiner.

    (wrong): RepositoryLocation loc = new RepositoryLocation("C:\Users\Quick\Documents\RapidMiner\test.xml")
    (correct): RepositoryLocation loc = new RepositoryLocation("//NewLocalRepository/test")

    Thank you again!
    User: "arunpushkar"
    New Altair Community Member
    @Quick as per your last post about location of process you said "repository path for the argument of RepositoryLocation() is not
    absolute path of process file but the location in RapidMiner." can you eloborate where in rapidMiner because i tried copying my repository and my process to various directory in rapidMiner folder but nothing worked.