In this post I will show you how to establish a connection to Microsoft SQL Server  from NetBeans IDE.

I use a Mac so the screenshots here are from Mac but NetBeans IDE is the same on all other platforms. There should not be any differences.

First thing we need to do is download the JDBC driver for Microsoft SQL Server from Microsoft. Current version of driver is 3.0 and it can be downloaded here. Download the drivers for UNIX and extract the archive on your machine. Once you have extracted the archive you’ll get a folder sqljdbc_3.0 under which there is another folder enu. Within enu are the jar files which implement JDBC drivers.

Now we will start the process to establish our connection to SQL Server from NetBeans. First thing click on Services tab and the Right Click on Databases and then click on New Connection.

Screen shot 2010-08-23 at 6.20.33 PM.png

You will see this window. Next to Driver Name click on the drop-down and choose New Driver…

NewImage.jpg

Here click on the Add button and browse to your jar file for SQL Server JDBC driver.

NewImage.jpg

NetBeans is now aware of SQL Server JDBC driver.  You can now start creating the connection to SQL Server. Enter the details for SQL Server. You will need the IP address, port which by default is 1433 and username and password.

NewImage3.jpg

Click OK and you will be connected to SQL Server.

On the Server tab in NetBeans under Database you’ll see your SQL Server. You can browse server objects, view tables, stored procedures etc.

NewImage5.jpg

You can also run SQL queries on your SQL Server from NetBeans IDE.

NewImage6.jpg

Tagged with:
 

2 Responses to Connect To SQL Server 2008 From NetBeans IDE On A Mac

  1. Partha Pratim Baral says:

    I am able to establish the connection but can not view the tables from Netbeans. I m using Netbeans5.5 and i am using jdbc driver 2.0
    can you plz post something to solve the problem

  2. amarnath says:

    i need of microsoft sql server 2005 for mac os and its jdbc driver

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> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>