Don't trust driver type metadata
--------------------------------

                 Key: GEOT-2016
                 URL: http://jira.codehaus.org/browse/GEOT-2016
             Project: GeoTools
          Issue Type: Bug
          Components: data h2
            Reporter: Andrea Aime
            Assignee: Justin Deoliveira
             Fix For: 2.5.0, 2.6-M0


createSchema uses jdbc metadata to find out the type name correspondent to a 
certain type. Unfortunately this cannot be trusted for Oracle database, using 
the ojdbc5.jar shipped with Oracle 11G results in the following type map:

(typeCode: typeName)
-104: INTERVALDS
-103: INTERVALYM
-102: TIMESTAMP WITH LOCAL TIME ZONE
-101: TIMESTAMP WITH TIME ZONE
-7: NUMBER
-6: NUMBER
-5: NUMBER
-4: LONG RAW
-3: RAW
-1: LONG
1: CHAR
2: NUMBER
4: NUMBER
5: NUMBER
6: FLOAT
7: REAL
12: VARCHAR2
92: DATE
93: DATE
93: TIMESTAMP
2002: STRUCT
2003: ARRAY
2004: BLOB
2005: CLOB
2006: REF

As you can see 91, which is Types.DATE, is not mapped. This is evidently a bug 
in the driver, yet the dialect should provide a way to circumvent this.
As a result, OracleDataStoreTest.testCreateSchema fails with an exception 
stating "dateProperty" is not mapped.

I suggest we add a SqlDialect.getTypeName(int typeCode) that returns the type 
name, or null if we want the metadata to be used instead.

-- 
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

Reply via email to