The circle class example

The circle class example implements a fixed-length opaque data type.

The circle data type includes X and Y coordinates (xCoord and yCoord), which represent the center of the circle and a radius value (radius). The readSQL method reads the input stream SQLInput to obtain the xCoord, yCoord, and radius values and saves the data type name from String typename. The writeSQL method writes the xCoord, yCoord, and radius values to the stream SQLOutput.
package informix.testclasses.jlm;

import java.sql.*;

public class circle implements SQLData
{
public int xCoord;
public int yCoord;
public int radius;
private String type;

   public String getSQLTypeName()
   {
      return type;
   }

   public void readSQL (SQLInput stream, String typeName)
      throws SQLException
   {
      xCoord = stream.readInt();
      yCoord = stream.readInt();
      radius = stream.readInt();

      type = typeName;
   }

   public void writeSQL (SQLOutput stream)
      throws SQLException
   {
      stream.writeInt(xCoord);
      stream.writeInt(yCoord);
      stream.writeInt(radius);
   }
}
The SQLData methods use I/O streams to translate between C and Java™ representations. The following C-language structure shows the C definition for the circle:
typedef struct
{
   int x;
   int y;
   int radius;
} circle;