Home > Automation Testing > MS SQL connection using JDBC in Selenium

MS SQL connection using JDBC in Selenium

To connect MS SQL database using jdbc driver in java, we need to download jdbc driver for MS SQL server. Refer below link to download MS SQL jdbc driver file. 

Add external Jar file to project:

  • Right click on project,
  • Go to properties → Java Build Path → Click on Library tab 
  • Add external library and click on apply and close button.

Create connection:

 

Execute prepared statement for Insert query

 

Execute select query and print data

 

This Article is TAGGED in , . BOOKMARK THE permalink.

Avatar photo
Neeraj Vishwakarma
Senior QA Engineer Skills: Automation Testing, Manual Testing, STLC, Java, Selenium Webdriver, Protractor, Database Testing.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">