Home arrow Java arrow Page 3 - Developing SQL Server based Java Apps using NetBeans IDE
JAVA

Developing SQL Server based Java Apps using NetBeans IDE


This article introduces you to developing Java (or JFC) based applications with Microsoft SQL Server as the database, using NetBeans IDE. In this first article in a series, I will show you how to establish a connection from your Java programs to a Microsoft SQL Server database using JDBC.

Author Info:
By: Jagadish Chaterjee
Rating: 4 stars4 stars4 stars4 stars4 stars / 27
May 24, 2006
TABLE OF CONTENTS:
  1. · Developing SQL Server based Java Apps using NetBeans IDE
  2. · What do we need to connect to Microsoft SQL Server from Java (or JDBC)?
  3. · How to configure CLASSPATH to connect to Microsoft SQL Server database
  4. · How to establish a Microsoft SQL Server database connection using JDBC
  5. · Creating a Microsoft SQL Server database connection using NetBeans IDE: Form Design
  6. · Creating a Microsoft SQL Server database connection using NetBeans IDE: the nucleus

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Developing SQL Server based Java Apps using NetBeans IDE - How to configure CLASSPATH to connect to Microsoft SQL Server database
(Page 3 of 6 )

When you install “Microsoft SQL Server 2000 driver for JDBC Service Pack 3,” it gets installed at the default path “C:Program FilesMicrosoft SQL Server 2000 Driver for JDBC.”  If you try to look at “C:Program FilesMicrosoft SQL Server 2000 Driver for JDBClib,” you will not be surprised to find the following files:

  • msbase.jar
  • mssqlserver.jar
  • msutil.jar

In the case of Microsoft SQL Server 2005, you may find different files/paths. All those files are required to be included in the CLASSPATH.  To include them in the CLASSPATH, you can follow the following steps.

  • Right click on “My Computer” and select “Properties.”
  • Go to “Advanced” tab.
  • Click on “Environment Variables” (Fig 01).


  • Within the “System Variables” section, you must see “CLASSPATH” in the first column.  If you are unable to see that, click on “Add” and proceed as in the following step.
  • Select “CLASSPATH” and click “Edit.”  Within the “Variable Value,” move to the last (without disturbing anything which exists) and paste the following paths:

    C:Program FilesMicrosoft SQL Server 2000 Driver for JDBClibmsbase.jar;C:Program FilesMicrosoft SQL Server 2000 Driver for JDBClibmssqlserver.jar;C:Program FilesMicrosoft SQL Server 2000 Driver for JDBClibmsutil.jar;.

You need to change the path based on its installation.  The above is the default installation path of Microsoft SQL Server 2000 JDBC driver.

Note that you need not follow the above steps, if you would like to use NetBeans IDE (or any other powerful Java IDE) for your Java application. The above steps are basically for Java developers who don’t use any IDE.


blog comments powered by Disqus
JAVA ARTICLES

- Deploying Multiple Java Applets as One
- Deploying Java Applets
- Understanding Deployment Frameworks
- Database Programming in Java Using JDBC
- Extension Interfaces and SAX
- Entities, Handlers and SAX
- Advanced SAX
- Conversions and Java Print Streams
- Formatters and Java Print Streams
- Java Print Streams
- Wildcards, Arrays, and Generics in Java
- Wildcards and Generic Methods in Java
- Finishing the Project: Java Web Development ...
- Generics and Limitations in Java
- Getting Started with Java Web Development in...

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 3 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials