UDT-JDBC data types conversion
Posted in 1999
Dear all,
I'm trying to use the geodetic datablade with java (via jdbc) on IUS
9.13. However I don't know how can I do the
mapping between the geoobjects UDT (defined in the geodetic datablade)
and the JDBC data types.
In the Informix JDBC1.4 driver there is a demo which explains a udt
query. However that one is just a
mapping from a udt to varchar and all the UDFs are provided and
compiled by the user which is not the case of the geodetic datablade.
I have something like:
create table t (name varchar(15), boundingbox Geobox);
String s = "select name, boundingbox::geobox from t";
while (rs.next()) {
String name = rs.getString("name");
System.out.println("\\tname " + name);
String boundingBox = (String)rs.getObject(2);
System.out.print("\\tBounding Box " + boundingBox);
}
Where Geobox is a complex data type defined in the geodetic datablade.
I've got the following error:
***ERROR: -79769 A customized type map is required for this data type.
java.sql.SQLException: A customized type map is required for this data
type.
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at java.sql.SQLException.<init>(SQLException.java:43)
at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:239)
at com.informix.jdbc.IfxUDT.toObject(IfxUDT.java:86)
at com.informix.jdbc.IfxResultSet.getObject(IfxResultSet.java:1176)
at com.informix.jdbc.IfxResultSet.getObject(IfxResultSet.java:529)
at gazetteer.<init>(Compiled Code)
at gazetteer.main(gazetteer.java:39)
Please, any comments are very wellcome.
Thanks in advance,
Claudio.
--
Claudio de Souza Baptista Research Student
Computing Laboratory CT2 7NZ
University of Kent at Canterbury Canterbury, Kent, UK