#!/bin/sh
# DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# bin=${DIR}/../bin
# lib=${DIR}/../lib
bin=$JDBC_IMPORTER_HOME/bin
lib=$JDBC_IMPORTER_HOME/lib
# echo $lib
num=$1
echo '
{
"type" : "jdbc",
"jdbc" : {
"url" : "jdbc:mysql://127.0.0.1:3306/adbug",
"user" : "root",
"password" : "",
"sql" : [ {
"statement" : "select *,id as _id from users where id>?",
"parameter" : '${num}'
} ],
"index" : "users",
"type" : "user_index",
"index_settings" : {
"index" : {
"number_of_shards" : 1
}
}
}
}
' | java \
-cp "${lib}/*" \
-Dlog4j.configurationFile=${bin}/log4j2.xml \
org.xbib.tools.Runner \
org.xbib.tools.JDBCImporter
# DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# bin=${DIR}/../bin
# lib=${DIR}/../lib
bin=$JDBC_IMPORTER_HOME/bin
lib=$JDBC_IMPORTER_HOME/lib
# echo $lib
num=$1
echo '
{
"type" : "jdbc",
"jdbc" : {
"url" : "jdbc:mysql://127.0.0.1:3306/adbug",
"user" : "root",
"password" : "",
"sql" : [ {
"statement" : "select *,id as _id from users where id>?",
"parameter" : '${num}'
} ],
"index" : "users",
"type" : "user_index",
"index_settings" : {
"index" : {
"number_of_shards" : 1
}
}
}
}
' | java \
-cp "${lib}/*" \
-Dlog4j.configurationFile=${bin}/log4j2.xml \
org.xbib.tools.Runner \
org.xbib.tools.JDBCImporter