org.hsqldb
Class JavaObject

java.lang.Object
  extended byorg.hsqldb.JavaObject

public class JavaObject
extends Object

Representation of an instance of OTHER field data.

Prior to 1.7.0 there were problems storing Objets of normal column types in columns of the type OTHER. In 1.7.0 changes were made to allow this, but as all the conversion took place inside the engine, it introduced a requirement for all classes for objects stored in OTHER columns to be available in the class path of the engine.

In 1.7.2, the introduction of real preprared statement support allows us revert to the pre 1.7.0 behaviour without the artificial limitations. The classes for stored objects need not be available to open and operate the database in general. The classes need to be available only if a conversion from one of these objects to another type is performed inside the engine while operating the database. Current limitation is that in SQL statements, values of type String (CHARACTER and related SQL types) cannot be stored in columns of type OTHER. This limitation does not exist for String values assigned to PreparedStatement variables.

Since:
1.7.2
Version:
1.7.2
Author:
fredt@users

Constructor Summary
JavaObject(byte[] data)
          This constructor is used inside the engine when an already serialized Object is read from a file (.log, .script, .data or text table source).
JavaObject(Object o, boolean serialise)
          This constructor is from classes implementing the JDBC interfaces.
 
Method Summary
 byte[] getBytes()
           
 int getBytesLength()
           
 Object getObject()
          This method is called from classes implementing the JDBC interfaces.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JavaObject

public JavaObject(byte[] data)
This constructor is used inside the engine when an already serialized Object is read from a file (.log, .script, .data or text table source).


JavaObject

public JavaObject(Object o,
                  boolean serialise)
           throws HsqlException
This constructor is from classes implementing the JDBC interfaces. Inside the engine, it is used to convert an object into an object of type OTHER.

Method Detail

getBytes

public byte[] getBytes()
                throws HsqlException
Throws:
HsqlException

getBytesLength

public int getBytesLength()
                   throws HsqlException
Throws:
HsqlException

getObject

public Object getObject()
                 throws HsqlException
This method is called from classes implementing the JDBC interfaces. Inside the engine it is used for conversion from a value of type OTHER to another type. It will throw if the OTHER is an instance of a classe that is not available.

Throws:
HsqlException

toString

public String toString()


Copyright © 2001 - 2004 HSQL Development Group. All Rights Reserved.