Csc 8710, Deductive Databases and Logic Programming (Fall 2012)

Homework 5 (Due: November 12th - Monday)

Consider the following IDB:
subPart(X,Y,Q,T) :- comp(X,Y,Q,T).
subPart(X,Y,Q,T) :- comp(Z,Y,Q2,T), subPart(X,Z,Q1,T1), Q is Q1 * Q2.
basicParts(P,Y,Q) :- subpart(P,Y,Q,b).
basicComp(P,B,sum(<Q>)) :- basicParts(P,B,Q).
partCost(P,X) :- basicComp(P,B,Q), price(B,C), X is Q * C.
cost(P,sum(<C>)) :- partCost(P,C).
The following are three EDB data sets (in Oracle SQL format): Write Java programs (or programs in any other language you are familiar with that can access an Oracle database) that will faithfully implement the
  1. Naive Algorithm.
  2. Semi-Naive Algorithm.
  3. Semi-Naive Algorithm on the magic-set transformed IDB.
Test your programs for correctness on small data set. Once you are certain, run your programs on the deep and the wide data sets to compare the performance of the three programs. You may compare timing; number of database inserts; etc. Submit your results in charts/plots.

JDBC Connection String

public static String CONNECTSTRING = 
  "jdbc:oracle:thin:@tinman.cs.gsu.edu:1521:tinman";

Simple Java Program using JDBC

ojdbc6.jar and ojdbc6_g.jar

Lab Manual Chapter on Java/JDBC access to Oracle