#Connect to Microsoft SQL Server in Java (Automation Script)

#Connect to Microsoft SQL Server in Java (Automation Script)

How to get data from DB at Automation Script, even update data at DB as you list, all of this depends on making a connection with DB server and by your Quary can make anything. So I will describe step by step how to connect to DB from IDE.

1-Download Microsoft JDBC Driver

this is easier to download by Maven from the Maven repo. then put it in POM.xml

https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc

this is the dependency that is responsible for JDBC Driver

2- Create a method to make a connection with DB as:

This method takes String Query and String... columns and each parameter inside this method is related to local DB on the local MS SQL Server on My PC

3- then call this method anywhere you need it, with its Query and columns that you need its value in case you need to get value

I give him Quarey as a photo and the columns that i need its value
this is the full Quary at DB
and this is the output of my code

To view or add a comment, sign in

Others also viewed

Explore topics