View data.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO app_user(username, first_name, last_name, password) | |
VALUES('user1', 'First 1', 'Last 1', '12345-1'); | |
INSERT INTO app_user(username, first_name, last_name, password) | |
VALUES('user2', 'First 2', 'Last 2', '12345-2'); | |
INSERT INTO app_user(username, first_name, last_name, password) | |
VALUES('user3', 'First 3', 'Last 3', '12345-3'); | |
INSERT INTO app_user(username, first_name, last_name, password) |
View world-logstash.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
co.Code 'code', | |
co.name 'name', | |
co.Continent 'continent', | |
co.region 'region', | |
co.SurfaceArea 'surface_area', | |
co.IndepYear 'year_of_independence', | |
co.Population 'population', | |
co.LifeExpectancy 'life_expectancy', | |
co.GovernmentForm 'government_form', |
View world-index.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"aliases":{}, | |
"warmers":{}, | |
"mappings": { | |
"world": { | |
"properties": { | |
"capital": { | |
"properties": { | |
"district": { | |
"type": "string" |
View world-importer.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
bin=${DIR}/../bin | |
lib=${DIR}/../lib | |
java \ | |
-cp "${lib}/*" \ | |
-Dlog4j.configurationFile=${bin}/log4j2.xml \ | |
org.xbib.tools.Runner \ |
View world-importer.bat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
set DIR=%~dp0 | |
set LIB=%DIR%..\lib\* | |
set BIN=%DIR%..\bin | |
REM ??? | |
"%JAVA8_HOME%\bin\java" -cp "%LIB%" -Dlog4j.configurationFile="%BIN%\log4j2.xml" "org.xbib.tools.Runner" "org.xbib.tools.JDBCImporter" world-importer-config.json |
View world-importer-config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type" : "jdbc", | |
"jdbc" : { | |
"password" : "******", | |
"user" : "root", | |
"url" : "jdbc:mysql://localhost:3306/world", | |
"sql" : [ { | |
"statement" : "world.sql" | |
} ], |
View world.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
co.Code '_id', | |
co.Code 'code', | |
co.name 'name', | |
co.Continent 'continent', | |
co.region 'region', | |
co.SurfaceArea 'surface_area', | |
co.IndepYear 'year_of_independence', | |
co.Population 'population', | |
co.LifeExpectancy 'life_expectancy', |
View ChainOfResponsibilityDemo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.List; | |
import java.util.ArrayList; | |
public class ChainOfResponsibilityDemo { | |
/** | |
* @param args | |
*/ | |
public static void main(String[] args) { | |
View XmlParser.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class XmlParser extends Parser { | |
@Override | |
public void parse(String fileName) { | |
if ( canHandleFile(fileName, ".xml")){ | |
System.out.println("A XML parser is handling the file: "+fileName); | |
} | |
else{ | |
super.parse(fileName); | |
} |
View CsvParser.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CsvParser extends Parser { | |
public CsvParser(Parser successor){ | |
this.setSuccessor(successor); | |
} | |
@Override | |
public void parse(String fileName) { | |
if ( canHandleFile(fileName, ".csv")){ | |
System.out.println("A CSV parser is handling the file: "+fileName); |
NewerOlder