O'Reilly logo

Database Programming with JDBC & Java, Second Edition by George Reese

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

SQLData

Synopsis

Interface Name: java.sql.SQLData

Superclass: None

Immediate Subclasses: None

Interfaces Implemented: None

Availability: New as of JDK 1.2

Description

This interface is implemented by custom Java objects designed to be stored as Java objects in a Java-relational database. Any Java class registered in a type mapping must implement this interface. Programmers should never make direct calls to these methods.

Class Summary

public interface SQLData {
    String getSQLTypeName( ) throws SQLException;
    void readSQL(SQLInput input, String tname)
      throws SQLException;
    void writeSQL(SQLOutput output) throws SQLException;
}

Object Methods

getSQLTypeName( )

public String getSQLTypeName( ) throws SQLException;
Description

This method provides the name of the SQL user-defined type to which this implementation of SQLData maps.

void readSQL( )

public void readSQL(SQLInput input, String tname)
  throws SQLException;
Description

Using data of the relational database from the input stream, this method assigns values to the object’s attributes. This method reads values from the input stream by calling the appropriate readXXX() methods in the SQLInput instance.

void writeSQL( )

public void writeSQL(SQLOutput output) throws SQLException;
Description

This method writes the attributes of this object to the specified output stream using the writeXXX() methods of the SQLOutput instance.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required