Add package import statements

In addition to any Java packages that you might need, you might also need to import several Java packages. Classes coded with IDL datatypes and classes coded with SQL datatypes require different import statements.

Chapter 1, “Java Classes and Interfaces,” in the EAServer API Reference provides reference pages for these packages.

Imports for classes implemented with SQL datatypes

The packages below are useful if your component is implemented using SQL datatypes:

Package(s)

Description

com.sybase.jaguar.server

Contains utility classes for use in server-side Java code.

com.sybase.jaguar.sql

Defines interfaces for defining and sending result sets. See “Sending result sets with Java” for details on using these classes.

com.sybase.jaguar.jcm

Provides the Java Connection Management (JCM) classes. See Chapter 26, “Using Connection Management” for a description of this feature.

com.sybase.jaguar.util

com.sybase.jaguar.util.jdbc11

Contain the JException class and the holder classes that are used to pass inout and out parameter values.

The fragment below shows the import statements for all of these classes:

import com.sybase.jaguar.server.*;
import com.sybase.jaguar.util.*;
import com.sybase.jaguar.util.jdbc11.*;
import com.sybase.jaguar.sql.*;
import com.sybase.jaguar.jcm.*;
import com.sybase.jaguar.beans.enterprise.*;

You can also import com.sybase.jaguar.*, but you must remember to include the rest of the package name when you specify methods.

Imports for classes implemented with IDL datatypes

The packages below are useful if your component is implemented using the standard CORBA IDL-to-Java datatype mappings:

Package(s)

Description

org.omg.CORBA

Contains Java holder and helper classes for each of the core CORBA datatypes. Also defines the interfaces for a standard Java client-side Object Request Broker.

com.sybase.CORBA.jdbc11.*

Contains utility classes for converting between EAServer IDL datatypes and core Java datatypes.

com.sybase.jaguar.server

Contains utility classes for use in server-side Java code.

com.sybase.jaguar.sql

Defines interfaces for defining and sending result sets. See “Sending result sets with Java” for details on using these classes.

com.sybase.jaguar.jcm

Provides the Java Connection Management (JCM) classes. See Chapter 26, “Using Connection Management” for a description of this feature.

com.sybase.jaguar.util.JException

Many of the methods in the EAServer Java classes throw JException. Note that the packages com.sybase.jaguar.util and org.omg.CORBA contain identically named classes, so you can not import all classes from both packages. To avoid compilation problems, import JException explicitly or always refer to this class by its full name.

The fragment below shows the import statements for all of these classes:

import org.omg.CORBA.*;
import com.sybase.CORBA.jdbc11.*;
import com.sybase.jaguar.util.JException;
import com.sybase.jaguar.server.*;
import com.sybase.jaguar.sql.*;
import com.sybase.jaguar.jcm.*;