Java Q&A
by Terry Smith

Example 1:

CREATE TABLE Member (
   MemberID         NUMBER(14) NOT NULL UNIQUE,
   FirstName        VARCHAR2(100) NOT NULL,
   LastName         VARCHAR2(100) NOT NULL,
   Email            VARCHAR2(100) NOT NULL UNIQUE,
   EmailBouncing    CHAR(1) DEFAULT 'F'
                            CHECK (EmailBouncing in ('T', 'F')),   
   Password         CHAR(30) NOT NULL,
   RegistrationDate Date,
   CONSTRAINT MEMBER_PRIMARY_KEY PRIMARY KEY (MemberID)
);


Example 2: 

MemberID           989487133880
FirstName          null
LastName           null
Email              null
EmailBouncing      false
Password           null
RegistrationDate   Fri Sep 08 09:56:11 CDT 2000


Example 3:
(a) 
try
{
   StringBuffer SQL = new StringBuffer();
   SQL.append("Insert into Member (MemberID, FirstName, ");
   SQL.append("LastName, Email, EmailBouncing, Password, ");
   SQL.append("RegistrationDate) ");
   SQL.append("Values (?, ?, ?, ?, ?, ?, ?)");
   Statement = dbConnection.prepareStatement( SQL.toString() );


(b) 
if ( m_MemberID == null )
  Statement.setNull( 1, java.sql.Types.NUMERIC );
else
  Statement.setLong( 1, m_MemberID.longValue() );




1


