The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here

Connection to AS400/DB2 database using JDBC Driver

LogicalObserverLogicalObserver Member Posts: 4 Learner I
Good day,

I am trying to connect to my AS400/DB2 databased using the Jt400 10.5.jar driver.

I am able to successfully connect (using test connection), however when running a simple SQL script (Read database operator) I am getting the below error:

  • Exception: java.lang.NullPointerException
  • Message: null
  • Stack trace:
  • com.rapidminer.extension.jdbc.operator.io.DatabaseDataReader.createExampleTable(DatabaseDataReader.java:259)
  • com.rapidminer.extension.jdbc.operator.io.DatabaseDataReader.createExampleSet(DatabaseDataReader.java:144)
  • com.rapidminer.operator.io.AbstractExampleSource.read(AbstractExampleSource.java:53)
  • com.rapidminer.extension.jdbc.operator.io.DatabaseDataReader.read(DatabaseDataReader.java:101)
  • com.rapidminer.extension.jdbc.operator.io.DatabaseDataReader.read(DatabaseDataReader.java:82)
  • com.rapidminer.operator.io.AbstractReader.doWork(AbstractReader.java:272)
  • com.rapidminer.operator.Operator.execute(Operator.java:1023)
  • com.rapidminer.operator.execution.SimpleUnitExecutor.execute(SimpleUnitExecutor.java:77)
  • com.rapidminer.operator.ExecutionUnit$2.run(ExecutionUnit.java:805)
  • com.rapidminer.operator.ExecutionUnit$2.run(ExecutionUnit.java:800)
  • java.security.AccessController.doPrivileged(Native Method)
  • com.rapidminer.operator.ExecutionUnit.execute(ExecutionUnit.java:800)
  • com.rapidminer.operator.OperatorChain.doWork(OperatorChain.java:423)
  • com.rapidminer.operator.Operator.execute(Operator.java:1023)
  • com.rapidminer.Process.executeRoot(Process.java:1464)
  • com.rapidminer.Process.lambda$executeRootInPool$5(Process.java:1443)
  • com.rapidminer.studio.concurrency.internal.AbstractConcurrencyContext$AdaptedCallable.exec(AbstractConcurrencyContext.java:362)
  • java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
  • java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
  • java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
  • java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175)
Any assistance would be greatly appreciated.

Kind regards

Best Answer

Answers

  • BalazsBaranyBalazsBarany Administrator, Moderator, Employee-RapidMiner, RapidMiner Certified Analyst, RapidMiner Certified Expert Posts: 955 Unicorn
    Hi,

    can you try it another Java based SQL client (SQuirrel SQL, SQL Workbench/J) with the same settings? 

    Regards,
    Balázs
  • jwpfaujwpfau Employee-RapidMiner, Member Posts: 303 RM Engineering
    edited April 2021
    Hi,

    The failing code is first asking the jdbc driver if the last date value was null and if not is reading the value.

    Can you try to disable parallel execution, to rule out some concurrency issue with the jdbc driver?
    To disable parallel execution go through the parent operators click on "Show advanced parameter" and deselect "enable parallel execution".

    Otherwise you could use the DB2 VARCHAR_FORMAT function to convert the date/time/timestamp columns to string until a patch is available.

    Greetings,
    Jonas
  • LogicalObserverLogicalObserver Member Posts: 4 Learner I
    @jwpfau, thanks so much for the feedback. 

    I do not see an enable parallel execution on the operators I am using (please see below). Additionally, I am not able to see the columns pull through in the Read_Database sql script builder.




  • LogicalObserverLogicalObserver Member Posts: 4 Learner I
    BalazsBarany I did try using the connection details with SQLSquirrel as well as DBeaver.

    I am able to successfully connect to the database from both of those clients using the same driver I have added in Rapidminer as below:

    com.ibm.as400.access.AS400JDBCDriver (jt400-10.5.jar)
     
  • LogicalObserverLogicalObserver Member Posts: 4 Learner I
    @jwpfau That worked perfectly!!! Thank you so much!!! 
Sign In or Register to comment.