Cannot create correct sql create statements with DB2 spatial extender
---------------------------------------------------------------------
Key: GEOT-2095
URL: http://jira.codehaus.org/browse/GEOT-2095
Project: GeoTools
Issue Type: Improvement
Components: data jdbc-ng
Affects Versions: 2.6-M0
Reporter: Christian Mueller
Priority: Blocker
The method
JDBCDataStore>> private String[] getSQLTypeNames(Class[] classes, Connection cx)
tries to map from java jts classes to sql type strings for the construction of
a create statement.
This method is using the integer jdbc types doing the following
1) get the integer jdbc type for a java jts class
2) get the db type string from the integer jdbc type
Spatial Extender has 8 concrete types
ST_GEOMETRY,ST_POINT,ST_LINE,ST_POLY ......
All this types map to the jdbc Types.STRUCT (which is 2002). It ist not to
possible to
create this mapping since each jts class has an jdbc type 2002 and the sql name
for 2002 is not deterministic.
Another problem is that I cannot use some randomly choosen numbers, I am not
sure that
the method PreparedStatement>>setNull(columnIndex,sqlType) will work.
Proposal:
1)
The JDBCDataStore has an instance Variable
sqlTypeNameToClassMappings
We need another one
classToSqlTypeNameMappings
which can be derived from sqlTypeNameToClassMappings (change keys and values)
and has no effect on the SQLDialect hierarchy.
2)
Whenever a jtc class to db type name lookup is needed, use the new map first.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel