public static void registerGeometryType(Connection connection) throws SQLException {
        Statement st = connection.createStatement();
        for(DomainInfo domainInfo : getBuiltInsType()) {
            // Check for byte array first, to not throw an enigmatic error CastException
            st.execute("CREATE DOMAIN IF NOT EXISTS "+domainInfo.getDomainName()+" AS "+GEOMETRY_BASE_TYPE+"("+domainInfo.getGeometryTypeCode()+") CHECK (ST_GeometryTypeCode(VALUE) = "+domainInfo.getGeometryTypeCode()+");");
        }
    }
public static void registerGeometryType ( Connection connection ) throws SQLException { Statement st = connection . createStatement ( ) ; for ( DomainInfo domainInfo : getBuiltInsType ( ) ) { st . execute ( "CREATE DOMAIN IF NOT EXISTS " + domainInfo . getDomainName ( ) + " AS " + GEOMETRY_BASE_TYPE + "(" + domainInfo . getGeometryTypeCode ( ) + ") CHECK (ST_GeometryTypeCode(VALUE) = " + domainInfo . getGeometryTypeCode ( ) + ");" ) ; } }
Register geometry type in an OSGi environment
@param connection Active H2 connection
@throws SQLException