Loading, please wait ...
Open its course - Database Systems Labs
Interface and DB Connectivity for Projects By Mukhtiar Zamin


Teachers with
Mukhtiar Zamin
For Learning
Security Status
By Teachers
  1. Students are auto-evaluated against related topics to ensure they learned it.

This lecture gives you some guidelines on the interface of your semester project and also describes the database connectivity with SQL for your Java based desktop applicaiton

SQL Server Connectivity with Java for All, By Subject Expert Admin

  1. Install Driver into your JAVA Project as:
    • Download JDBC driver from Microsoft website and unzip it on your computer
    • Add the correct driver into your project. Driver JRE version should be same or less than installed JDK
      • In NetBeans main menu open  "Tool > Options" click "Java > Java Shell" 
      • Again "Java Platform:" you see your default active JDK with version
      • In your JAVA Applicaiotn (Ant type NOT Gradle or Maven) right click on Libraries sub-node in Projects view tab
      • Locate the correct unzipped driver and click OK
  2. Check Driver is working fine without code 
    • You can check if the driver is working by:
      1. Open NetBeans main menu open "Window > Services"
      2. Expand "Databases" and right-click on Drivers and click "New Driver"
      3. Click on Add button, Locate and select the correct jre driver version and click on Open and then OK
      4. Right Click on "Microsoft SQL Server" and then "Connect using ..."
      5. Provide UserName and Password and then click on "Test Connection" button, if successful then use the JDBC URL in your code.
  3. If step-2 failed then use the following the Troubleshoot Connectivity Issues below.

SQL Server Connectivity Issues for All, By Subject Expert Admin

References : https://learn.microsoft.com/en-us/sql/connect/jdbc/troubleshooting-connectivity?view=sql-server-ver16

  1. Ensure SQL Server is running
    • From Start open "Services" and locate "SQL Server ..." service is running, If not then start the server
    • Optionally you can check it from "SQL Server Management Studio"
    • Use SQL Server Authentication instead of Windows Authentication
      • Right-Click on Instance and open Properties
      • On Security node select "SQL Server and Windows Authentication mode" radio button and click OK
    • Reset and Enable Logins under Security > Logins node by creating a new user or set "sa" password
  2. Ensure TCP/IP is enabled for SQL Server by:
    • Open "SQL Server Configuration" from Start menu OR Open from "C:\Windows\SysWOW64\SQLServerManager15.msc" file, Note that instead of 15 you may have different version in file name "SQLServerManager15.msc"
    • Enable TCP/IP under "SQL Server Network Configuraiton \ Protocols for SQLEXPRESS"
    • Double Click on TCP/IP and open "IP Addresses" tab
    • Scroll to bottom and note the TCP Port under "IPALL" node
    • If it is 1433 then not need to provide the port in making a connection if different then it is mandatory to use that port in connection.  
    • You can test this by "telnet 1433" where you can only replace the IP or port to check
  3. Ensure the port that is used by the server has been opened in the firewall.
  4. The specified server name, database name, user id and password are correct.


Interface and DB Connectivity for Projects Evaluation

To earn PASS status, system is about to evaluate you using multiple choice questions (MCQs) and True/False type questions.

  • Make sure you have learned this lecture along with its topics and tutorials.
  • On first evaluation you get 100% marks on correct answer, then on 2nd you get 95% marks and so on.
  • Answer the questions with a gap NOT MORE THAN A MINUTE, Otherwise it will re-start.

I have read above instrucitons and ready for evaluation.
Not Registered
Mukhtiar Zamin
Please ask your teacher to link related questions for this lecture.
Your performance monitoring will start when you register in a class of this course.

Questions on

No Linked topics!
Contact Us

Write to Us View Help
Subject Expert Logo

Subject Expert

Learn, Evaluate and Optimize

Follow Us
Facebook Switch Display Mode Enable Translation
© 2023 - Subject Expert