Skip to content

Command line Java app to test JDBC connection to Microsoft SQL Server Database using 9.2.0 SQL Server JDBC driver.

Notifications You must be signed in to change notification settings

aimtiaz11/ms-sqlserver-jdbc-tester

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ms-sqlserver-jdbc-tester

A simple Spring Boot command line application to test JDBC connection to SQL Server database.

Maven Build Status

How to run

Download the JAR from release page or alternatively checkout the code from this repository and run:

mvn clean package

Execute the JAR file. Example below:

java -jar target/ms-sqlserver-jdbc-1.0.jar "jdbc:sqlserver://mydatabase.db.windows.net:1433;database=My_Example_DB;[email protected];password=secret123;encrypt=true;trustServerCertificate=true;loginTimeout=90;authentication=ActiveDirectoryPassword"

Security Tip: A good practise is to read the JDBC string into a variable using the read command in Linux to prevent DB credentials in JDBC string to be logged in bash history.

How it works

To test the JDBC connection, the app will attempt to connect to SQL Server and execute a single SQL query: SELECT SUSER_SNAME() and close connection.

License

(The MIT License)

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Command line Java app to test JDBC connection to Microsoft SQL Server Database using 9.2.0 SQL Server JDBC driver.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages