Hitachi Vantara Pentaho Community Forums
Results 1 to 8 of 8

Thread: Anyone Successfully using weka to pull data from Oracle?

  1. #1
    Join Date
    Oct 2006
    Posts
    16

    Default Anyone Successfully using weka to pull data from Oracle?

    It seems to me there are many hoops to jump through in order to simply pull data from Oracle.

    I am apparently stuck trying to simply read data from oracle. I was able to get through the headache of connecting to Oracle.

    Now I have this problem.

    Weka is encountering a strange data type: VARCHAR2.


    Has anyone else slayed this dragon?

    I would expect some of this database stuff to be relatively simple. Just copy the ojdbc14.jar into your local path like you have to do in PDI or something like that and you are up and running.

    I have seen email threads and posts that mention modifications to your CLASSPATH, modifications to a properties file, making sure you have a properties file in the correct location (USERPROFILE), updating the properties file so that you have data types set correctly, etc...

    If anyone would assist me in getting this to work, I don't mind putting together a step-by-step HOWTO for weka to get this thing to simply read data from Oracle.

    My expectation is that we should have something like this eventually:


    Step1: install Weka.
    Step2: copy ojdbc14.jar to local directory or specify jar location.
    Step3: specify your SID and login details.
    Step4: analysis/exploration/experimentation.

    Can anyone assist in providing some guidance to solve the difficult problem of reading data from Oracle?


    Thanks.

  2. #2
    Join Date
    Jul 2007
    Posts
    1,013

    Default

    Here are the steps to follow:

    1) place ojdbc14.jar in a known location. I'm assuming "c:\ojdbc14.jar" for this example.

    2) Extract "DatabaseUtils.props.oracle" from the "weka/experiment/" directory inside "weka.jar" (which is just a zip file, in case you're not familiar with it).

    3) Copy "DatabaseUtils.props.oracle" as "DatabaseUtils.props" to the weka installation directory (the same directory where you can find weka.jar).

    4) Modify "DatabaseUtils.props" to fit your needs. I'm attaching an example. You'll see that there's a mapping for VARCHAR2 as well as CHAR. You can add more if weka complains about not being able to handle a specific type.

    5) Start weka with the following command: "javaw -Xmx512m -classpath .;weka.jar;c:\ojdbc14.jar weka.gui.Main". (This must be run from the weka install directory, otherwise fix the path to weka.jar and the root weka install dir as needed. Also remember to enter the correct path to the jdbc driver).

    6) When you start weka, you should see your DB URL in the "URL" box of the "Open DB..." dialog. Simply input your user info with the "User" button, and you should be able to connect and query.

    Hope this helps. Let me know if it's not clear enough and we can work on it

    Cheers!
    Attached Files Attached Files

  3. #3
    Join Date
    Oct 2006
    Posts
    16

    Default Thank you

    Thank you.

    This got me through the issues I was having.

    I can now pull data directly from the original table in oracle.


    Nice concise instructions.

    Pulling pieces of instructions from multiple places was making things difficult.

    Thanks again.

    Doug

  4. #4
    Join Date
    Jul 2007
    Posts
    1,013

    Default

    Glad it helped. Cheers!

  5. #5
    Join Date
    Jan 2009
    Posts
    1

    Default Exception - Anyone Successfully using weka to pull data from Oracle?

    Hi,

    I followed the instructions given by tdidomenico but I ended up with the exception below.

    What am I doing wrong? Any help??

    "exception: java.sql.SQLException: No suitable driver found for jdbcracle:thin:@172.16.5.163:1521:masteritem"

    my driver is "jdbcDriver=oracle.jdbc.driver.OracleDriver" and I am using Oracsle 10g Enterprise Edition (Not Express)

    Thank you

  6. #6
    Join Date
    Feb 2013
    Posts
    1

    Default

    please can you explain more how to link oracle db with weka??

  7. #7
    Join Date
    Mar 2016
    Posts
    1

    Default

    Quote Originally Posted by Heba View Post
    please can you explain more how to use the sizegenetics extender link oracle db with weka??
    Yeah, I was wondering how to do this too, I still don't get it as I get the "exception: java.sql.SQLException" error every time.
    Last edited by PrezAdam; 12-23-2016 at 07:06 AM.

  8. #8
    Join Date
    Aug 2006
    Posts
    1,741

    Default

    This exception indicates that the driver class is not getting found, so you're classpath is not set correctly. If you are using Weka 3.7, then there is a package (installable via the package manager) called JDBCDriversDummyPackage. Install this package and you will get a place to put JDBC driver jar files, which will then be placed into the classpath for Weka automatically. Once this package is installed just copy/move your Oracle JDBC driver jar into $HOME/wekafiles/packages/JDBCDriversDummyPackage/lib. Then restart Weka.

    Cheers,
    Mark.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.