Error-message-handler example  Prerequisites for storing java objects as column data

Chapter 2: Programming Information

Storing Java objects as column data in a table

Some database products enable you to directly store Java objects as column data in a database. In such databases, Java classes are treated as datatypes, and you can declare a column with a Java class as its datatype.

jConnect supports storing Java objects in a database by implementing the setObject( ) methods defined in the PreparedStatement interface and the getObject( ) methods defined in the CallableStatement and ResultSet interfaces. This allows you to use jConnect with an application that uses native JDBC classes and methods to directly store and retrieve Java objects as column data.

NoteTo use getObject( ) and setObject( ), set the jConnect version to VERSION_4 or later. See “Setting the jConnect version”.

The following sections describe the requirements and procedures for storing objects in a table and retrieving them using JDBC with jConnect:

Note Adaptive Server version 12.0 and later and Adaptive Server Anywhere version 6.0.x and later can store Java objects in a table, with some limitations. See the jConnect for JDBC Release Bulletin for more information.





Copyright © 2003. Sybase Inc. All rights reserved. Prerequisites for storing java objects as column data

View this book as PDF