Java
News
Brief

DECEMBER
ISSUE
Merry Christmas !
St. Louis: 12140
Woodcrest Executive Drive, Suite 250, St. Louis, MO 63141
Office:
314-579-0066
Tempe:
4500 S. Lakeshore Drive, Suite 359, Tempe, AZ
85282 Office: 480-752-0042
1-888-962-4624 
Headlines:
Java Technical Insight of the Month
- Accessing Relational Data with
JDBC
The Java News Brief Archive - New
OCI Education Center - Open
Enrollment Schedule - New Evening Adv.
Java Course
Why Java? here are a few
reasons...
Java Technical Insight of the Month
Accessing Relational Data with JDBC
Weiqi
Gao, Senior Software Engineer, Object Computing, Inc.
The JDBC API is a Java API for accessing relational
(tabular) data, especially those stored in a relational database.
JDBC has been an integral part of Sun's Java Development Kit since 1.1, and is
supported by virtually all relational database vendors.
Pieces
of the puzzle
To use JDBC, several pieces of software must be
installed:
The JDBC API is easy to use
The
JDBC API gives database access code an object-oriented feel. Here's a
snippet of very simple JDBC code that queries a database with an employee table
for the last_name and hobby fields and prints out the result (we used the
Connection, Statement, ResultSet classes):
import java.sql.*;
public class employee {
public static void main(String[] args) {
try {
// Load the driver class
Class.forName("postgresql.Driver");
// Make a connection
Connection conn = DriverManager.getConnection
("jdbc:postgresql://myhost/mydatabase", "myuserid", "mypassword");
// Create a SQL statement
Statement stmt = conn.createStatement();
// Execute a query
ResultSet rs = stmt.executeQuery
("select first_name, hobby from employee");
// Fetch the data from the query result set
while (rs.next()) {
System.out.println("first_name: " + rs.getString(1));
System.out.println("hobby: " + rs.getString(2));
}
} catch (Exception e) {
System.out.println("Exception: " + e.getMessage());
}
}
}
Benefits of JDBC
Aside from being
easy to use, the JDBC API also brings the following benefits:
JDBC is the basis for other
technologies
The JDBC API offers the Java platform a standard way
of accessing relational data. Many other technologies use the JDBC API as a low
level tool to build higher level abstractions. Enterprise JavaBeans (EJB)
servers usually use JDBC API for their persistence mechanism.
JDBC 2.0
With the release of the
Java 2 Platform comes the JDBC API 2.0. This new version of the JDBC API offers
many more features in addition to the ones offered in JDBC API 1.x.
Most noticable are scrollable result sets, batch updates, and advanced data
types.
The JDBC API 2.0 standard extension (javax.sql.*) offers JNDI support, connection pooling, and distributed transactions.
More information
The following web
resource has more information about JDBC: http://java.sun.com/products/jdbc/:
(The official Sun Java JDBC site.)
The Java News Brief
Archive -
New
All issues of the JNB
are now online for your convenience and can be accessed at http://www.ociweb.com/jnb/index.html.
OCI Education Center -
Open Enrollment Schedule
Mesa & Tempe, Arizona
- St. Louis ,Missouri
Click Course Titles (below) for course
description
| Course Title | Facility | Dates | Hours |
|---|---|---|---|
| CORBA Programming |
St.
Louis Mesa |
Jan
11-14 Mar 28-31 |
8:30-3:30 8:30-3:30 |
| Advanced CORBA Programming using TAO (for Real-Time) | St. Louis | Feb 8-11 | 8:30-3:30 |
| Object Oriented Concepts | St. Louis | Jan 19 | 8:30-3:30 |
| Java Syntax for Non-C Programmers | St. Louis | Jan 20-21 | 8:30-3:30 |
| Java Programming | St.
Louis Mesa Mesa |
Feb
1-4 Feb 7-10 Mar 7-10 |
8:30-3:30 8:30-3:30 8:30-3:30 |
| Advanced Java Programming | Tempe Mesa Mesa |
Jan
10,12,17,19,24,26 Jan 24-26 Feb 21-23 |
6:00-9:00 p.m. 8:30-3:30 8:30-3:30 |
| Enterprise JavaBeans | St. Louis | Feb 23-25 | 8:30-3:30 |
For more information or to register email training.
Why
Java? here
are a few reasons...
Portability
- application logic, user
interfaces, database access; ...not perfect portability but much better than
other languages.
Support for Web-based
Applications - applets for client-side processing; servlets for
server-side processing
Built-in support for
multi-threading
Built-in support for socket communication
Support of
network protocols
Provides multiple ways of creating distributed applications
- sockets, RMI, CORBA, Enterprise Java Beans, Mobile Agents, Servlets
and JavaSpaces
Object-Oriented - reuse; maintainability,
extensibility
Automatic garbage-collection (memory
management)
Productivity - easier syntax than C++, no need
to relink after each code change (speeds debugging)
Object Computing, Inc. is a Sun Authorized Java Center in St. Louis and a Member of the Object Management Group, OMG. OCI provides Consulting, Education, and Product Development services to clients nation-wide. For more information email info.
For employment opportunities at OCI call
1-888-962-4624 or email hr.
The Java News Brief is a monthly
newsletter. The purpose and intent of this publication is to advance Java,
provide technical value, and to announce available OCI Java services. If
you would prefer to not receive this newsletter or would like to subscribe
please email JNB and enter
SUBSCRIBE or UNSUBSCRIBE within the Subject line.
Copyright (c)
1999. Object Computing, Inc. All rights
reserved. Java and all Java-based marks are
trademarks or registered trademarks of Sun Microsystems, Inc. in the United
States and other countries. Object Computing, Inc. is independent of Sun
Microsystems, Inc.