JDBC Connect String on tinman:
try {
conn = DriverManager.getConnection (
"jdbc:oracle:thin:@tinman.cs.gsu.edu:1521:sid9ir2",
"userid","password");
} catch (SQLException e1) {
out.println("Error connecting to Oracle:"+e1.getMessage());
return;
}
sibling(X,Y) :- parent(X,Z), parent(Y,Z), X <> Y. cousin(X,Y) :- parent(X,Xp), parent(Y,Yp), sibling(Xp,Yp). cousin(X,Y) :- parent(X,Xp), parent(Y,Yp), cousin(Xp,Yp). related (X,Y) :- sibling(X,Y). related(X,Y) :- related(X,Z), parent(Y,Z). related(X,Y) :- related(Z,Y), parent(X,Z).Keep track of the total number of SQL "insert" statements that are submitted to the server for each IDB predicate. Print the number of inserts for each predicate.
query(X) :- cousin("tom",X).
The magic sets transformed IDB is:
magic_cousin_bf("tom").
magic_cousin_bf(Xp) :- parent(X,Xp), magic_cousin_bf(X).
magic_sibling_bf(Xp) :- parent(X,Xp), magic_cousin_bf(X).
query(X) :- cousin_bf(h,X).
cousin_bf(X,Y) :- parent(X,Xp), parent(Y,Yp), sibling_bf(Xp,Yp),
magic_cousin_bf(X).
cousin_bf(X,Y) :- parent(X,Xp), parent(Y,Yp), cousin_bf(Xp,Yp),
magic_cousin_bf(X).
sibling_bf(X,Y) :- parent(X,Z), parent(Y,Z), X <> Y,
magic_sibling_bf(X).
Keep track of the total number of SQL "insert" statements that are submitted
to the server for each IDB predicate.