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.

Get Database Programming with JDBC & Java, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.