Home arrow Java arrow Page 3 - Getting Set with J2EE
JAVA

Getting Set with J2EE


Before you can work with J2EE 1.4 SDK, you need to make sure it is set up correctly. This article, the first of two parts, will help you do that. The second part will take you through writing a simple application. It 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).

Author Info:
By: Apress Publishing
Rating: 4 stars4 stars4 stars4 stars4 stars / 13
December 08, 2005
TABLE OF CONTENTS:
  1. · Getting Set with J2EE
  2. · Installing the J2EE 1.4 SDK
  3. · Starting the Database Server
  4. · Starting the J2EE Server

print this article
SEARCH DEVARTICLES

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


blog comments powered by Disqus
JAVA ARTICLES

- Java Too Insecure, Says Microsoft Researcher
- Google Beats Oracle in Java Ruling
- 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 ...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




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