JDBC Driver for SQL/MP 3.0

The Properties object can also contain other connection-related properties and their values, such as logon ID,
password, alias, and so on. The Properties object can also be created by loading the properties from a file. In either
case, the format for all BLOB properties must be the same.
Note: After a Properties object has been specified while creating a database connection, the connection is
aware of only those BLOB properties specified during connection creation. Any changes or updates made
to the Properties object after the connection has been granted are invisible to that connection.
The JDBC drivers use the specified Properties object to ascertain which columns will be used for storing BLOBs for
every table the application will use. The JDBC drivers use the BLOB properties to decide if the object to be stored or
retrieved is a BLOB. The BLOB properties are also used to decide the location where a BLOB file should be created
for a particular BLOB column in a table.
The JDBC drivers also provide some preliminary error checking on the BLOB properties. The error checking ensures
that all information required in a BlobInfo property has been provided, and that all file names and file locations are in
the correct $volume.subvolume format.
After a connection to the database has been granted to an application, the application can then use JDBC to access and
use BLOBs as it would any other SQL/MP supported data type. Client applications can use JDBC to:
Write a BLOB to a database table
Retrieve a BLOB from a database table
Update a BLOB stored in a database table
Delete a row containing a BLOB from a database table
Writing a BLOB to the Database
A JDBC application can write a BLOB to the database using the setObject( ) method in the PreparedStatement
interface. Using the SQL/MP JDBC Driver, a BLOB can be written to a database table using any of these methods
supported by SQLMPPreparedStatement:
public void setObject(int parameterIndex, Object x, int targetSqLType, int scale)
public void setObject(int parameterIndex, Object x, int targetSqLType)
public void setObject(int parameterIndex, Object x)
where:
parameterIndex
is the parameter to be set.
x
is any serializable Java object.
targetSqlType
should be java.sql.Types.OTHER
scale
is ignored for BLOBs.
Errors encountered during the writing of a BLOB to a BLOB file generate an SQLException in this format:
SQLMP: error message. See File System error ## for further details.
where:
error message
is the error encountered while performing this operation.
error ##