From 291e56ae99f77b563bf4241e12b317bda28b6819 Mon Sep 17 00:00:00 2001 From: Rizwan Ishtiaq Date: Sun, 31 Jul 2022 16:05:58 +0100 Subject: [PATCH] generate fat jar containing oracle jdbc dependency adds mvn dependency for ojdbc mvn compiler and fat jar file plugin --- .gitignore | 2 ++ README.MD | 17 +++++++++++++---- pom.xml | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 61 insertions(+), 5 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ec376bb --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.idea +target \ No newline at end of file diff --git a/README.MD b/README.MD index 88e26b6..d2544f4 100644 --- a/README.MD +++ b/README.MD @@ -1,18 +1,25 @@ # SQL-dumper -Command line tool, that dumps the result of SQL to an CSV on the filesystem. +Command line tool, that dumps the result of Oracle SQL to an CSV on the filesystem. Queries can be using "extended SQL" split into subqueries, reducing the complexity on the server side. If you want to contribute, please see the [contribution guidelines](#contributing). **Installation**: +`git clone repo` -Download [Oracle JDBC Driver 12c](http://www.oracle.com/technetwork/database/features/jdbc/jdbc-drivers-12c-download-1958347.html) (tested with this version.) and put sql-dumper.jar and ojdbc7.jar in one folder. Note that the ojdbc7.jar file can not be gathered by maven, it has to be added manually to the project. To do so in IntelliJ IDEA, press Ctrl+Alt+Shift+S, go to "Libraries", and select the file from your local disc. +`mvn clean package` + +target directory will have two jars sql-dumper.jar and sql-dumper-jar-with-dependencies.jar + +When using minimal jar file (sql-dumper.jar) Please +Download [Oracle JDBC Driver 12c](http://www.oracle.com/technetwork/database/features/jdbc/jdbc-drivers-12c-download-1958347.html) +(tested with this version.) and put sql-dumper.jar and ojdbc7.jar in one folder. **Usage** is easy: - java -jar sql_dumper.jar sqlPath outPath user pass jdbc + java -jar sql-dumper-jar-with-dependencies.jar sqlPath outPath user pass jdbc with the arguments being: @@ -20,7 +27,9 @@ with the arguments being: - `outPath`: Path to a folder, where the .CSV will be dumped, e.g. `"C:\path\to\csv\"` - `user`: Your username to access the database, if in doubt surrounded by `""`, e.g. `"myusername"` - `pass`: Your password to access the database, e.g. `"123myPassword"` -- `jdbc`: The `JDBC` connection string to establish the connection, e.g. `"jdbc:oracle:thin:@sdwh.company.com:1333:sdwh"` +- `jdbc`: The `JDBC` connection string to establish the connection + - e.g. `"jdbc:oracle:thin:@sdwh.company.com:1333:sdwh"` when sdwh is sid + - e.g. `"jdbc:oracle:thin:@//sdwh.company.com:1333/sdwh"` when sdwh is service name The outputted CSV files will be saved to a sub directory of `outpath` following the convention `YYYY_MM_DD\` and be named after the SQL script file in the input directory (`myScript.SQL` will lead to a resultfile named `myScript.CSV`). diff --git a/pom.xml b/pom.xml index ff137fd..bc11080 100644 --- a/pom.xml +++ b/pom.xml @@ -6,8 +6,53 @@ de.bernhard-schlegel sql_dumper - 0.0.3 + 0.0.5 + + com.oracle.database.jdbc + ojdbc8 + 12.2.0.1 + + + + sql-dumper + + + org.apache.maven.plugins + maven-compiler-plugin + 3.6.1 + + 1.8 + 1.8 + + + + + org.apache.maven.plugins + maven-assembly-plugin + + + jar-with-dependencies + + + + true + sqldump.Main + + + + + + make-assembly + package + + single + + + + + + \ No newline at end of file