Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #JDBCFetch - A tool for taking data out of a database and placing it into a Harvester silo for further processing
- #-----
- #Detailed description of tool
- #Version - The version number is provided so that the classpath will be
- # referring to the correct jar file during execution.
- # If it is set to an incompatable version the resulting effects to
- # the data harvested are unpredictable.
- Version=1.2beta
- #CLASSPATH_OPT - This option is added to the HARVESTER_JAVA_OPTS so
- # that the intended classpath is included.
- # If it is changed ensure that it continues to include the data
- # within the required jar file dependencies. Without those
- # dependencies the code will not execute.
- CLASSPATH_OPT="-cp lib/d2rmap-V03.jar:bin/harvester-${Version}.jar:bin/dependency/*"
- #JDBCdriver - This would be the driver class which the JDBCFetch will use
- # To communicate with the database. The driver must agree with the
- # type of database, otherwise the communication between the harvester
- # and the database will be unclear.
- # Some examples of JDCBdriver classes are:
- # org.h2.Driver used to communicate with H2 style databases
- JDBCdriver="org.h2.Driver"
- #JDBCconnection - The connection string is used by JDBC fetch to get a
- # connection to a particular database.
- # The format of the string is in 3 parts divided by colons
- # part one - "jdbc" signifies its a jdbc connection
- # part two - "h2" is the driver specfic format that the databse is in
- # part three - The location of the database storage file
- JDBCconnection="jdbc:h2:harvested-data/example-jdbc/clone/store"
- #JDBCusername and JDBCpassword are the username and password to use when
- # accessing the given database. These must be valid otherwise the
- # harvest run will not have access to the database.
- # By default we use "sa" for system administrator and a blank password.
- JDBCusername="sa"
- JDBCpassword=""
- #The beginning of the first table set for information gathering
- # each table set has values that end with a number. The script may need
- # to be altered in order to make sure that each table set is used.
- # A table set is a series of values
- #JDBCtablename - This is the name of the table to be harvested from. It needs
- # to agree with an existing table or view within the database specificed
- # by the JDBCconnection.
- JDBCtablename1="people"
- #JDBCid - This is a field or set of fields within the table which are distinct
- # and are able to differentiate between entries. Any of the fields can be
- # placed in this value.
- # A composite identifier can be created if a single field is not distinct.
- # Composite identifiers are created by using comma separated tablenames
- # instead of a single tablename.
- JDBCid1="UID"
- #JDBCquery - The JDBCFetch can use a SQL query to pull information out of the
- # Database. The format of the query is standard and is placed here as a
- # series of concatnated statements. The separate statements are placed in
- # order to give line-breaks for editing.
- # This query assembles the information related to people from the people
- # table. The AS statements ensure that the data is properly named for
- # the translation step to be able to translate the data into properly
- # formed RDF
- JDBCquery1="SELECT"
- JDBCquery1=$JDBCquery1 "emp.person_id AS UID,"
- JDBCquery1=$JDBCquery1 "emp.first_name AS FNAME, "
- JDBCquery1=$JDBCquery1 "emp.last_name AS LNAME, "
- JDBCquery1=$JDBCquery1 "emp.middle_name AS MNAME, "
- JDBCquery1=$JDBCquery1 "emp.prefix_name AS PRENAME, "
- JDBCquery1=$JDBCquery1 "emp.suffix_name AS SUFNAME, "
- JDBCquery1=$JDBCquery1 "emp.full_name AS FULLNAME, "
- JDBCquery1=$JDBCquery1 "emp.official_name AS BUSNAME, "
- JDBCquery1=$JDBCquery1 "emp.pref_title AS TITLE, "
- JDBCquery1=$JDBCquery1 "emp.email_address AS EMAIL, "
- JDBCquery1=$JDBCquery1 "emp.work_phone AS PHONE, "
- JDBCquery1=$JDBCquery1 "emp.work_fax AS FAX, "
- JDBCquery1=$JDBCquery1 "login.login_name AS NETID "
- JDBCquery1=$JDBCquery1 "FROM person AS emp "
- JDBCquery1=$JDBCquery1 "LEFT JOIN user AS login ON "
- JDBCquery1=$JDBCquery1 " emp.person_id = login.person_id AND login.expired = 0 "
- JDBCquery1=$JDBCquery1 "WHERE "
- JDBCquery1=$JDBCquery1 " emp.publish_ok = 1"
- #JDBCquery - The JDBCFetch can use a SQL query to pull information out of the
- # Database. The format of the query is standard and is placed here as a
- # series of concatnated statements. The separate statements are placed in
- # order to give line-breaks for editing.
- # This query assembles the information related to positions from the positions
- # table. The AS statements ensure that the data is properly named for
- # the translation step to be able to translate the data into properly
- # formed RDF
- JDBCtablename2="positions"
- JDBCid2="UID,TYPE,DEPTID,STARTDATE"
- JDBCquery2="SELECT"
- JDBCquery2=$JDBCquery2 "emp.person_id AS UID,"
- JDBCquery2=$JDBCquery2 "pos.type_id AS TYPE, "
- JDBCquery2=$JDBCquery2 "pos.dept_id AS DEPTID, "
- JDBCquery2=$JDBCquery2 "pos.start_date AS STARTDATE, "
- JDBCquery2=$JDBCquery2 "code.value AS WORKTITLE "
- JDBCquery2=$JDBCquery2 "FROM job AS pos "
- JDBCquery2=$JDBCquery2 "INNER JOIN person AS emp ON "
- JDBCquery2=$JDBCquery2 " pos.person_id = emp.person_id "
- JDBCquery2=$JDBCquery2 "INNER JOIN person AS emp ON "
- JDBCquery2=$JDBCquery2 " pos.person_id = emp.person_id "
- JDBCquery2=$JDBCquery2 "WHERE "
- JDBCquery2=$JDBCquery2 " pos.type_id IN (121,122,254,392,393) AND"
- JDBCquery2=$JDBCquery2 " emp.publish_ok = 1"
- #JDBCquery - The JDBCFetch can use a SQL query to pull information out of the
- # Database. The format of the query is standard and is placed here as a
- # series of concatnated statements. The separate statements are placed in
- # order to give line-breaks for editing.
- # This query assembles the information related to organizations from the
- # organizations table. The AS statements ensure that the data is properly
- # named for the translation step to be able to translate the data into
- # properly formed RDF.
- JDBCtablename3="organizations"
- JDBCid3="DEPTID"
- JDBCquery3="SELECT"
- JDBCquery3=$JDBCquery3 "dept.dept_id AS DEPTID,"
- JDBCquery3=$JDBCquery3 "dept.dept_name AS NAME, "
- JDBCquery3=$JDBCquery3 "dept.type_id AS TYPE, "
- JDBCquery3=$JDBCquery3 "dept.super_dept_id AS SUPERDEPTID "
- JDBCquery3=$JDBCquery3 "FROM department AS dept "
Add Comment
Please, Sign In to add comment