|
Spatial DataBlade JAVA API v8.21 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.spatial.io.IfxSQLData
public class IfxSQLData
This class implements the interface com.informix.jdbc.UDTSQLData specified by Informix JDBC drivers for accessing user-defined SQL types.
Applications must call enableTypes
before reading geometry objects from an IBM Informix Spatial database, in
order to enable mapping of database user defined types for a JDBC
connection. Until this method is called, geometry objects cannot be sent
to or received from the server using the JDBC connection.
Note: this API was tested with the IBM Informix JDBC driver version 2.21.JC2.
Constructor Summary | |
---|---|
IfxSQLData()
Constructor |
Method Summary | |
---|---|
static java.util.Map |
enableTypes(java.sql.Connection conn)
Must be called to enable the spatial type mapping for a JDBC connection. |
GeometryReader |
getReader()
Returns a copy of the reader used by this object to read and decode geometry data from an SQL stream. |
java.lang.Object |
getSQLDataObject()
Returns the desired java object |
java.lang.String |
getSQLTypeName()
Returns the fully-qualified name of the SQL user-defined type that this object represents. |
GeometryWriter |
getWriter()
Returns a copy of the writer used by this object to encode and write geometry data to an SQL stream. |
void |
readSQL(java.sql.SQLInput stream,
java.lang.String type)
Reads data from the database and creates an appropriate geometry object to hold it. |
IfxSQLData |
setObject(java.lang.Object data)
Sets the object to be written to the database server. |
void |
writeSQL(java.sql.SQLOutput stream)
Writes this object to the given SQL data stream. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IfxSQLData()
Method Detail |
---|
public java.lang.Object getSQLDataObject() throws java.sql.SQLException
getSQLDataObject
in interface com.informix.jdbc.UDTSQLData
java.sql.SQLException
- if the internal data object is nullpublic java.lang.String getSQLTypeName()
getSQLTypeName
in interface java.sql.SQLData
public void readSQL(java.sql.SQLInput stream, java.lang.String type) throws java.sql.SQLException
readSQL
in interface java.sql.SQLData
stream
- an SQLInput object from which to read the datatype
- the SQL type name of the value on the data stream
java.sql.SQLException
- if there is a read errorpublic void writeSQL(java.sql.SQLOutput stream) throws java.sql.SQLException
writeSQL
in interface java.sql.SQLData
java.sql.SQLException
- if there is a write errorpublic IfxSQLData setObject(java.lang.Object data)
data
- the actual object to be written to the database server
public GeometryReader getReader()
If no reader is already cached, this method will get an appropriate reader from the SpatialManager and return a copy of it.
public GeometryWriter getWriter()
If no writer is already cached, this method will get an appropriate writer from the SpatialManager and return a copy of it.
public static final java.util.Map enableTypes(java.sql.Connection conn) throws SpatialException
conn
- The JDBC connection for which spatial types are to be
enabled.
SpatialException
- if an error occurs
|
Spatial DataBlade JAVA API v8.21 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |