SunQuest
 
       Java
  Home arrow Java arrow Page 3 - Getting Set with J2EE
Moblin
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  
Dedicated Servers  
Actuate Whitepapers 
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

Getting Set with J2EE
By: Apress Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 10
    2005-12-08

    Table of Contents:
  • Getting Set with J2EE
  • Installing the J2EE 1.4 SDK
  • Starting the Database Server
  • Starting the J2EE Server

  • 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

    Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!

    Getting Set with J2EE - Starting the Database Server


    (Page 3 of 4 )

    When you install the J2EE 1.4 SDK, a sample database called PointBase is also installed. Well be using this database later on in the book, so we need to ensure that the database is ready for use by starting it and testing it out.

    From the Windows Start menu, choose the following option:

    Start | All Programs | Sun Microsystems | J2EE 1.4 SDK | Start PointBase

    After a second or two you should see a command window with the message:

    Server started, listening on port 9092, display level: 0 ...
    >

    This indicates that the database server has started. The next step is for you to work with the database server from the console of the interactive SQL tool for the PointBase database. To do this, open a new command window and start the PointBase Console by invoking the following command at the command line:

    > %J2EE_HOME%\pointbase\tools\serveroption\startconsole.bat

    The dialog shown below should appear, in which you should select the Open specified Database radio button, and enter the following into the labeled text boxes:

    1. Driver: com.pointbase.jdbc.jdbcUniversalDriver
    2. URL: jdbc:pointbase:server://localhost:9092/sun-appserv-samples
    3. User: PBPUBLIC
    4. Password: PBPUBLIC

                                                          

    After a second or two you will see the PointBase Console, shown below:

    We'll create a database table and test it. Enter the SQL commands shown below into the Enter SQL Commands panel, and click the Execute All icon. Make sure that each line ends with a semicolon, which tells the interactive that the command is complete. These commands create the zootable and insert three rows into it. The results should be similar to what you see in the ExecuteAll tab of the screenshot above.

    create table zootable (animal varchar(12) primary key, legcount int);
    insert into zootable values ('duck',2); insert into zootable values ('horse',4); insert into zootable values ('aardvark',4);

    Now you can run a SQL query to see the data that you've added. Type the following SQL query into the Enter SQL Commands panel, and click the Execute All icon to execute the query:

    select * from zootable;

    The interactive tool will query the database and print the results of the query:

    SQL> select * from zootable;
    ANIMAL         LEGCOUNT
    ----------     -----------
    duck           2
    horse          4
    aardvark       4
    3 Rows Selected. select * from zoot..., Total 0.391 secs, Compile 0.13 secs

    One last step--we want to delete the table before we exit. Type the SQL command, followed by a semicolon, and click the Execute All icon:

    drop table zootable;

    Exit the PointBase Console by choosing Exit from the File menu.

    When you are finished with PointBase, you can stop it by choosing the following option from the Start menu:

    Start | All Programs | Sun Microsystems | J2EE 1.4 SDK | Stop PointBase

    More Java Articles
    More By Apress Publishing


       · This article is an excerpt from the book "Beginning J2EE 1.4 From Novice to...
     

    Buy this book now. This article is excerpted from chapter two of the book Beginning J2EE 1.4 From Novice to Professional, written by James L. Weaver, Kevin Mukhar, and Jim Crume (Apress, 2005; ISBN: 1590593413). Check it out at your favorite bookstore today. Buy this book now.

    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 6 hosted by Hostway