<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Karthik Chiranjeevi</title>
    <description>The latest articles on DEV Community by Karthik Chiranjeevi (@karthikchiru12).</description>
    <link>https://dev.to/karthikchiru12</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F127261%2Ff112018b-4c10-49f6-b804-0596996e33fe.jpeg</url>
      <title>DEV Community: Karthik Chiranjeevi</title>
      <link>https://dev.to/karthikchiru12</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/karthikchiru12"/>
    <language>en</language>
    <item>
      <title>Connect Oracle 10g express edition with Weka</title>
      <dc:creator>Karthik Chiranjeevi</dc:creator>
      <pubDate>Wed, 09 Jan 2019 16:45:12 +0000</pubDate>
      <link>https://dev.to/karthikchiru12/how-to-connect-oracle-10g-express-edition-with-weka-tool-2ipp</link>
      <guid>https://dev.to/karthikchiru12/how-to-connect-oracle-10g-express-edition-with-weka-tool-2ipp</guid>
      <description>&lt;h3&gt;
  
  
  Requirements :
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;You need to download and install Oracle 10g express edition in your system.
Download the Oracle 10g express edition from &lt;a href="https://www.downloadsource.net/1770835/oracle-database-10g-express-edition/"&gt;here&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;You need to download and install the Weka tool in your system.
Download the weka tool from &lt;a href="http://prdownloads.sourceforge.net/weka/weka-3-8-3-x64.exe"&gt;here&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Procedure :
&lt;/h3&gt;

&lt;p&gt;In order to connect your Database(Oracle 10gXE) with the weka tool you need to have the &lt;strong&gt;DatabaseUtils.props&lt;/strong&gt; file. Generally, this file should be placed inside the props folder in your &lt;em&gt;WEKA_HOME&lt;/em&gt;(which is mostly &lt;strong&gt;C:/Users/%YourUsername%/wekafiles/&lt;/strong&gt;). DatabaseUtils.props file contains the configuration that is needed by weka tool to use JDBC driver to connect the database.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;WEKA_HOME&lt;/em&gt; path in your system can be known by opening the weka tool and then clicking on the &lt;em&gt;help&lt;/em&gt; menu and then selecting the &lt;em&gt;Systeminfo&lt;/em&gt; option.&lt;br&gt;
This will open a new window where you can find key and value table. Then note down your &lt;em&gt;WEKA_HOME&lt;/em&gt; path value.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4QldkvNQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/hu5zrbzxr6n9i3b0vi3h.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4QldkvNQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/hu5zrbzxr6n9i3b0vi3h.PNG" alt="alt text" title="Systeminfo" width="800" height="578"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now create a file named DatabaseUtils.props ,here &lt;em&gt;.props&lt;/em&gt; is extension. And copy below text and paste it in the DatabaseUtils.props file. Then save the file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
# Database settings for Oracle 10g Express Edition
#
# General information on database access can be found here:
# http://weka.wikispaces.com/Databases
#
# url:     http://www.oracle.com/
# jdbc:    http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/
# author:  Fracpete (fracpete at waikato dot ac dot nz)
# version: $Revision$

# JDBC driver (comma-separated list)
jdbcDriver=oracle.jdbc.driver.OracleDriver

# database URL
jdbcURL=jdbc:oracle:thin:@server_name:1521:XE

# specific data types
# string, getString() = 0;    --&amp;gt; nominal
# boolean, getBoolean() = 1;  --&amp;gt; nominal
# double, getDouble() = 2;    --&amp;gt; numeric
# byte, getByte() = 3;        --&amp;gt; numeric
# short, getByte()= 4;        --&amp;gt; numeric
# int, getInteger() = 5;      --&amp;gt; numeric
# long, getLong() = 6;        --&amp;gt; numeric
# float, getFloat() = 7;      --&amp;gt; numeric
# date, getDate() = 8;        --&amp;gt; date
# text, getString() = 9;      --&amp;gt; string
# time, getTime() = 10;       --&amp;gt; date

VARCHAR2=0
NUMBER=2
DOUBLE_PRECISION=2
TIMESTAMP=8

# other options
CREATE_INT=INTEGER
CREATE_STRING=VARCHAR2(4000)
CREATE_DOUBLE=NUMBER
CREATE_DATE=TIMESTAMP
DateFormat=yyyy-MM-dd HH:mm:ss
checkUpperCaseNames=true
checkForTable=true

# All the reserved keywords for this database
# Based on the keywords listed at the following URL (2009-04-13):
# http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/ap_keywd.htm
Keywords=\
  ACCESS,\
  ADD,\
  ALL,\
  ALTER,\
  AND,\
  ANY,\
  AS,\
  ASC,\
  AUDIT,\
  BETWEEN,\
  BY,\
  CHAR,\
  CHECK,\
  CLUSTER,\
  COLUMN,\
  COMMENT,\
  COMPRESS,\
  CONNECT,\
  CREATE,\
  CURRENT,\
  DATE,\
  DECIMAL,\
  DEFAULT,\
  DELETE,\
  DESC,\
  DISTINCT,\
  DROP,\
  ELSE,\
  EXCLUSIVE,\
  EXISTS,\
  FILE,\
  FLOAT,\
  FOR,\
  FROM,\
  GRANT,\
  GROUP,\
  HAVING,\
  IDENTIFIED,\
  IMMEDIATE,\
  IN,\
  INCREMENT,\
  INDEX,\
  INITIAL,\
  INSERT,\
  INTEGER,\
  INTERSECT,\
  INTO,\
  IS,\
  LEVEL,\
  LIKE,\
  LOCK,\
  LONG,\
  MAXEXTENTS,\
  MINUS,\
  MLSLABEL,\
  MODE,\
  MODIFY,\
  NOAUDIT,\
  NOCOMPRESS,\
  NOT,\
  NOWAIT,\
  NULL,\
  NUMBER,\
  OF,\
  OFFLINE,\
  ON,\
  ONLINE,\
  OPTION,\
  OR,\
  ORDER,\
  PCTFREE,\
  PRIOR,\
  PRIVILEGES,\
  PUBLIC,\
  RAW,\
  RENAME,\
  RESOURCE,\
  REVOKE,\
  ROW,\
  ROWID,\
  ROWNUM,\
  ROWS,\
  SELECT,\
  SESSION,\
  SET,\
  SHARE,\
  SIZE,\
  SMALLINT,\
  START,\
  SUCCESSFUL,\
  SYNONYM,\
  SYSDATE,\
  TABLE,\
  THEN,\
  TO,\
  TRIGGER,\
  UID,\
  UNION,\
  UNIQUE,\
  UPDATE,\
  USER,\
  VALIDATE,\
  VALUES,\
  VARCHAR,\
  VARCHAR2,\
  VIEW,\
  WHENEVER,\
  WHERE,\
  WITH

# The character to append to attribute names to avoid exceptions due to
# clashes between keywords and attribute names
KeywordsMaskChar=_

#flags for loading and saving instances using DatabaseLoader/Saver
nominalToStringLimit=50
idColumn=auto_generated_id

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now place this DatabaseUtils.props file in &lt;strong&gt;C:/Users/%profile%/wekafiles/props/&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Next, you need to find your host name[of your pc]. To find that...&lt;br&gt;
Open tnsnames.ora file with notepad which is located in the directory where oracle is installed. Typically tnsnames.ora is located in &lt;strong&gt;%Oracle_10g%/app/oracle/product/10.2.0/server/NETWORK/ADMIN/tnsnames.ora&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jU7gxBPI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/kkx9an19jvww1fxmftg6.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jU7gxBPI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/kkx9an19jvww1fxmftg6.PNG" alt="alt text" title="tnsnames.ora" width="800" height="264"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the above image, my host value is &lt;em&gt;DESKTOP-60BT53C&lt;/em&gt;. Note down the value of the host.&lt;br&gt;
Then place the value of host in place of &lt;em&gt;server_name&lt;/em&gt; in DatabaseUtils.props file as shown in the image below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cmtVkU23--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/q763oqs67ngo9uaawfgr.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cmtVkU23--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/q763oqs67ngo9uaawfgr.PNG" alt="alt text" title="jdbcURL" width="800" height="121"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, you need to add the JDBC Driver to the classpath. To do this in a simple way we are going to download a package in the weka tool.&lt;br&gt;
Open the weka tool and click on &lt;strong&gt;Tools&lt;/strong&gt; menu and select &lt;strong&gt;Package manager&lt;/strong&gt;.&lt;br&gt;
A new window opens where you can search for the package &lt;strong&gt;JDBCDriversDummyPackage&lt;/strong&gt; and install it.&lt;br&gt;
After instaling, you will get a screen like one below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZKsa8dxk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/j5ctf5l5jtqds9aau20t.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZKsa8dxk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/j5ctf5l5jtqds9aau20t.PNG" alt="alt text" title="JDBCDriverDummyPackage" width="800" height="417"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now open the directory where Oracle is installed. And there will be a &lt;em&gt;.jar&lt;/em&gt; file in this path &lt;strong&gt;%Oracle_10g%/app/oracle/product/10.2.0/server/jdbc/lib/ojdbc14.jar&lt;/strong&gt;.&lt;br&gt;
Now copy the file &lt;strong&gt;ojdbc14.jar&lt;/strong&gt; from this path. And paste the ojdbc14.jar in the JDBCDriversDummyPackage folder in %Wekahome/packages/ %&lt;strong&gt;C:/Users/%profile%/wekafiles/packages/JDBCDriversDummyPackage/ojdbc14.jar&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now open weka tool and you can use the jdbc_URL and your username and password which you use in &lt;em&gt;RunSQLCommandLine&lt;/em&gt; of Oracle_10g.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ni3h1FmD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/jjmsaftyqka7l9hsdeyi.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ni3h1FmD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/jjmsaftyqka7l9hsdeyi.PNG" alt="alt text" title="connect" width="800" height="498"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And click on &lt;em&gt;connect&lt;/em&gt; to connect to the Oracle database using weka tool.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--S4_W_irs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/sc7v8q6wci3pq1kjo649.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--S4_W_irs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/sc7v8q6wci3pq1kjo649.PNG" alt="alt text" title="connect" width="800" height="562"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>oracle</category>
      <category>weka</category>
    </item>
  </channel>
</rss>
