Skip to content

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnold Somogyi committed Jul 14, 2020
1 parent 18148b8 commit 907f6ad
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 3 deletions.
56 changes: 54 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,56 @@
java -jar target/sql-runner-1.0-with-dependencies.jar -j jdbc:oracle:thin:@//localhost:1521/ORCLPDB1.localdomain -U "SYS as SYSDBA" -P "Oradoc_db1" "select * from SLM.APPLICATION"
# TODO: this content needs to be updated and finished

java -jar target/sql-runner-1.0-with-dependencies.jar -h localhost -p 1521 -d ORCLPDB1.localdomain -U "SYS as SYSDBA" -P "Oradoc_db1" "select * from SLM.APPLICATION"
[release note](release.md)

The tool can be used from script files.
A possible Docker use case to check whether the database server is ready to receiver incoming connections or not:
~~~
#!/bin/bash
until java -jar sql-runner-1.0-with-dependencies.jar -j jdbc:oracle:thin:@//oracle-db:1521/ORCLPDB1.localdomain -U "SYS as SYSDBA" -P Oradoc_db1 "select 1 from dual"
do
echo "The database server in not up and running. Waiting..."
# sleep 0.5
done
echo ok
~~~

**Usage**
~~~~
Usage: SqlRunner [-?sv] [-t=<dialect>] -U=<user> (-P=<password> | -I) (-j=<jdbcUrl> | (-h=<host>
-p=<port> -d=<sid>)) <sql>
SQL command line tool. It executes the given SQL and show the result on the standard output.
General options:
<sql> SQL to be executed. Example: 'select 1 from dual'
-?, --help Display this help and exit.
-v, --verbose It provides additional details as to what the tool is doing.
-t, --dialect=<dialect> SQL dialect used during the execution of the SQL statement. Supported
SQL dialects: ORACLE.
Default: ORACLE
-s, --showHeader Shows the name of the fields from the SQL result set.
-U, --user=<user> Name for the login.
Specify a password for the connecting user:
-P, --password=<password> Password for the connecting user.
-I, --iPassword Interactive way to get the password for the connecting user.
Custom configuration:
-h, --host=<host> Name of the database server.
-p, --port=<port> Number of the port where the server listens for requests.
-d, --database=<sid> Name of the particular database on the server. Also known as the SID in
Oracle terminology.
Provide a JDBC URL:
-j, --jdbcUrl=<jdbcUrl> JDBC URL, example: jdbc:oracle:<drivertype>:@//<host>:<port>/<database>.
Exit codes:
1 Successful program execution.
2 An unexpected error appeared while executing the SQL statement.
3 Usage error. User input for the command was incorrect.
~~~~

**Examples**
* `java -jar target/sql-runner-1.0-with-dependencies.jar -j jdbc:oracle:thin:@//localhost:1521/ORCLPDB1.localdomain -U "SYS as SYSDBA" -P "Oradoc_db1" "select * from SLM.APPLICATION"`
* `java -jar target/sql-runner-1.0-with-dependencies.jar -h localhost -p 1521 -d ORCLPDB1.localdomain -U "SYS as SYSDBA" -P "Oradoc_db1" "select * from SLM.APPLICATION"`
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<groupId>com.remal.sqlrunner</groupId>
<artifactId>sql-runner</artifactId>
<version>1.0</version>
<version>0.1.0</version>

<licenses>
<license>
Expand Down
13 changes: 13 additions & 0 deletions release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Release info
## `sql-runner`

All notable changes to this project will be documented in this file.

### [0.1.0] - 2020-Jul-07
#### Added
- Initial version based on the requirements

### [x.y.z] - yyyy-mm-dd
#### Added
#### Changed
#### removed

0 comments on commit 907f6ad

Please sign in to comment.