Developing SQL Server based Java Apps using NetBeans IDE


Автор: Jagadish Chaterjee

From: http://www.devarticles.com/c/a/Java/Developing-Java-Applications-using-NetBeans/

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. A downloadable file for this article is available here.

I already introduced about NetBeans IDE in my previous article “Developing Java Applications using Netbeans.” Even though that particular article is fairly introductory, the next two articles concentrated on the basics of JFC. You can find them here and here.

If you are new to NetBeans IDE, I strongly suggest you go through the existing articles first, before proceeding with this one.

The entire code for this article is freely available in the form of a zip file. That downloadable solution was developed using NetBeans 4.1 IDE and tested with Microsoft SQL Server 2000 database Enterprise Edition (with Service Pack 3). I didn’t really test it in any other version. If you are unable to connect to the respective database, please post in the discussion section, so that I may guide you.

Another issue is that this entire article focuses on the Microsoft platform only. The steps I discuss in this article would never help you for any other operating system (except the programming code). I used Microsoft Windows 2003 Standard Edition to work this sample. I request you to follow the steps according to the operating system installed on your computer. Most of them will be very similar to follow and very easy to understand.

First of all, what is a tool? Initially, when Sun Microsystems first released Java (or JDK), there existed no tool to develop any productive Java application. In fact, in those days, everybody used to develop and practice Java programming using their own favorite text editor (some even used notepad). You can imagine, developing and debugging a Java program using a simple text editor is quite a tedious job. I hope any programmer in this world would definitely take a look at the Visual Basic (any version) environment. It is considered to be a well known IDE (Integrated Development Environment) and RAD (Rapid Application Development) environment. Being myself a Microsoft programmer, I really like to work with any environment which is close to that of the Visual Studio environment. Based on programmer demand, several companies (including Sun Microsystems) released their own productive development tools (or IDEs) for faster Java application development. The companies include Borland, Oracle, and others. Microsoft also initially contributed (with Visual J++ 1.x) and later gave up. Such top products were tightly licensed and very expensive. There existed then (and even now) several free Java IDE tools, but none of them really met all the requirements.

Java Studio Creator is build on NetBeans 4.x and includes the latest features of Java such as JSF (Java Server Faces), access to any database, streamlined IDE based application model, and more. When we install the tools, it automatically installs JDK (Java Development Kit), Sun Java System Application Server 8.1 Platform Edition and a sample database. The most amazing point is that the applications can be developed with no knowledge of configuration or deployment. If you have any external JSF components, you can simply configure them using "drag-and-drop." Apart from all of the above, it also includes Query Editor, CSS Editor, Web Services Development and even the astonishing JSP/EJB. One important issue to keep in mind is that it can be used only for web application (or portlet) development using technologies such as JSP, EJB and so on. Those who are familiar with VS.NET (and have a little background in Java web development) can start working with this IDE almost in no time. Sun Java Studio Enterprise, on the other hand, is for both enterprise architects and developers. This product is also based on the NetBeans platform. Sun Java Studio Enterprise internally supports UML architecting and design, collaborations among teams of developers, Web Services development, SOA (Service Oriented Architecture) architecting, portlet development, application server, portable database and more and more. In fact, you can develop "anything" with Java using this tool (including applications for the desktop, web, enterprise, mobile devices, and so on). And can you imagine that it is absolutely free!! The NetBeans Mobility Pack is mainly focused on working with Java technology based (or enabled) mobile devices. It works internally with J2ME (Micro Edition). We can develop mobile based Java applications using this simple (or scaled-down) IDE. It completely solves the problem of creating device-specific code for cases such as specific phone models, phones with only monochrome displays or varying screen sizes, and all other device-specific issues. You can easily integrate third-party emulators and SDKs for a robust testing environment, and for some models of mobile phone, debug directly on the device via Bluetooth technology. The next one is NetBeans.org (or simply NetBeans IDE). It is an open source IDE and an application platform written in the Java programming language. It has been a very simple and flexible IDE which can be considered a scaled-down version of Sun Java Studio Enterprise. It supports almost all types of application development including console based, desktop, web, and so on. If you need to learn Java with a tool that will give you a kick start, I suggest you try this.

Designed by Olya Orda