Java
  Home arrow Java arrow Traversing To and Fro with SQL Server Base...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Moblin 
JMSL Numerical Library 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVA

Traversing To and Fro with SQL Server Based Java Applications using NetBeans IDE
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2006-06-28

    Table of Contents:
  • Traversing To and Fro with SQL Server Based Java Applications using NetBeans IDE
  • How to connect to the database during form load
  • The Java code from IDE
  • The source code for buttons
  • How to handle the clear memory resources when the form is closed

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Traversing To and Fro with SQL Server Based Java Applications using NetBeans IDE


    (Page 1 of 5 )

    This series introduces you to a step-by-step process for developing Java (or JFC) based applications with Microsoft SQL Server as the database, using NetBeans IDE. In this article (which is the last in this series), I shall introduce you to traversing through a set of rows more efficiently. This will be a bit different from any of the articles in this series.
    A downloadable file for this article is available here.

    I already introduced the NetBeans IDE in my previous article "Developing Java Applications using NetBeans."  Even though that article is fairly introductory, the next two articles concentrate on the basics of JFC.  You can find the next two articles 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. If you are new to developing Microsoft SQL Server based Java applications, I request that you go through another article of mine here.

    Creating a Java application using NetBeans IDE

    We shall develop a small application with four labels, four text boxes and four buttons. The buttons will be identical to the usage of FIRST, PREVIOUS, NEXT and LAST. The "Northwind" database, by default doesn't have an "emp" table.  I just created it for simplicity; you can find its structure along with the rows of that table in my previous article.

    Currently, I named the project "SampleJavaApplication1" and the form (or JFrame) "DBSample06" in the package "MyDBPack."

    Before dropping all controls onto the form, set the layout to "null layout" (fig 01) to ease our development for this article. When you complete your form design, it should look something like Fig 1 and the "inspector" view should look something like Fig 2.


    Fig 1


    Fig 2

    For the convenience of writing understandable code, I named those controls as follows:

    txtEmpno
    txtEname
    txtSal
    txtDeptno
    btnFirst, btnPrevious, btnNext, btnLast
    lblMsg
    jLabel1, jLabel2, jLabel4, jLabel5 (default names)

    I also gave a value to the Frame property "title" (using the property window) of "Traversing Java."

    You are also required to import necessary packages as shown below:

    import java.sql.*;

    More Java Articles
    More By Jagadish Chaterjee


       · Hello guys. Another contribution on working with sql server and java. enjoy
     

    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...






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
    Stay green...Green IT