-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Arnold Somogyi
committed
Jul 14, 2020
1 parent
18148b8
commit 907f6ad
Showing
3 changed files
with
68 additions
and
3 deletions.
There are no files selected for viewing
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
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"` |
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
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
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 |