You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by "Eric Ferrer (JIRA)" <ji...@apache.org> on 2005/12/08 20:34:09 UTC

[jira] Created: (OJB-80) OJB support of Oracle's bfile attribute

OJB support of Oracle's bfile attribute
---------------------------------------

         Key: OJB-80
         URL: http://issues.apache.org/jira/browse/OJB-80
     Project: OJB
        Type: Bug
  Components: ODMG-API  
    Versions: 1.0.3    
 Environment: ALL
    Reporter: Eric Ferrer


We are using the BFILE type in Oracle and  org.apache.ojb.broker.util.JdbcTypesHelper.java does not support BFILE.  We have added the support for BFILE in this class but we would like it to be standardize in OJB.  This would make the upgrading to different ojb builds a lot easier.

Thanks.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


[jira] Commented: (OJB-80) OJB support of Oracle's bfile attribute

Posted by "Armin Waibel (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/OJB-80?page=comments#action_12442544 ] 
            
Armin Waibel commented on OJB-80:
---------------------------------

Hi Eric,

the only way to include  oracle's BFILE support is to implement it via reflection - see a modified implementation below.
What do you think would be the better solution: 
1. add BFILE support via reflection
2. add a T_BFile implementation hint in documentation (e.g. in FAQ)

regards,
Armin 

    /**
     * Oracle's BFILE type
     */
    public static final class T_BFile extends BaseType
    {

        public Object sequenceKeyConversion(Long identifier) throws SequenceManagerException
        {
            throw new SequenceManagerException("Not supported sequence key type 'BFILE'");
        }


        Object readValueFromStatement(CallableStatement stmt, int columnIndex) throws SQLException
        {
            throw new SQLException("not supported");
        }


        Object readValueFromResultSet(ResultSet rs, String columnName) throws SQLException
        {
            byte[] result = null;
            try
            {
                Object bfile = rs.getObject(columnName);
                bfile.getClass().getMethod("open", new Class[]{}).invoke(bfile, new Object[]{});
                if(!rs.wasNull())
                {
                    int len = ((Long) bfile.getClass().getMethod("length", new Class[]{}).invoke(bfile, new Object[]{})).intValue();
                    result = new byte[len];
                    InputStream stream = (InputStream) bfile.getClass().getMethod("getBinaryStream()", new Class[]{}).invoke(bfile, new Object[]{});
                    stream.read(result);
                    bfile.getClass().getMethod("close", new Class[]{}).invoke(bfile, new Object[]{});
                }
                bfile.getClass().getMethod("close", new Class[]{}).invoke(bfile, new Object[]{});
            }
            catch(SQLException e)
            {
                throw e;
            }
            catch(Exception e)
            {
                throw new OJBRuntimeException("Can't read Oracle's BFILE type", e);
            }
            return result;
        }


        Object readValueFromResultSet(ResultSet rs, int columnIndex) throws SQLException
        {
            throw new SQLException("not supported");
        }


        public int getType()
        {
            return Types.BLOB;
        }
    }

> OJB support of Oracle's bfile attribute
> ---------------------------------------
>
>                 Key: OJB-80
>                 URL: http://issues.apache.org/jira/browse/OJB-80
>             Project: OJB
>          Issue Type: Bug
>          Components: ODMG-API
>    Affects Versions: 1.0.3
>         Environment: ALL
>            Reporter: Eric Ferrer
>         Attachments: JdbcTypesHelper.java
>
>
> We are using the BFILE type in Oracle and  org.apache.ojb.broker.util.JdbcTypesHelper.java does not support BFILE.  We have added the support for BFILE in this class but we would like it to be standardize in OJB.  This would make the upgrading to different ojb builds a lot easier.
> Thanks.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


[jira] Commented: (OJB-80) OJB support of Oracle's bfile attribute

Posted by "Jakob Braeuchi (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/OJB-80?page=comments#action_12359940 ] 

Jakob Braeuchi commented on OJB-80:
-----------------------------------

please attach your pathed JdbcHelper to this issue

> OJB support of Oracle's bfile attribute
> ---------------------------------------
>
>          Key: OJB-80
>          URL: http://issues.apache.org/jira/browse/OJB-80
>      Project: OJB
>         Type: Bug
>   Components: ODMG-API
>     Versions: 1.0.3
>  Environment: ALL
>     Reporter: Eric Ferrer

>
> We are using the BFILE type in Oracle and  org.apache.ojb.broker.util.JdbcTypesHelper.java does not support BFILE.  We have added the support for BFILE in this class but we would like it to be standardize in OJB.  This would make the upgrading to different ojb builds a lot easier.
> Thanks.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


[jira] Commented: (OJB-80) OJB support of Oracle's bfile attribute

Posted by "Jakob Braeuchi (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/OJB-80?page=comments#action_12360440 ] 

Jakob Braeuchi commented on OJB-80:
-----------------------------------

cannot include this class into ojb because it depends on oracle classes.

will make setJdbcType... methods public to allow users to add their own types.



> OJB support of Oracle's bfile attribute
> ---------------------------------------
>
>          Key: OJB-80
>          URL: http://issues.apache.org/jira/browse/OJB-80
>      Project: OJB
>         Type: Bug
>   Components: ODMG-API
>     Versions: 1.0.3
>  Environment: ALL
>     Reporter: Eric Ferrer
>  Attachments: JdbcTypesHelper.java
>
> We are using the BFILE type in Oracle and  org.apache.ojb.broker.util.JdbcTypesHelper.java does not support BFILE.  We have added the support for BFILE in this class but we would like it to be standardize in OJB.  This would make the upgrading to different ojb builds a lot easier.
> Thanks.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


[jira] Updated: (OJB-80) OJB support of Oracle's bfile attribute

Posted by "Eric Ferrer (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/OJB-80?page=all ]

Eric Ferrer updated OJB-80:
---------------------------

    Attachment: JdbcTypesHelper.java

Here is the file.  You can find the additions be searching for bfile

> OJB support of Oracle's bfile attribute
> ---------------------------------------
>
>          Key: OJB-80
>          URL: http://issues.apache.org/jira/browse/OJB-80
>      Project: OJB
>         Type: Bug
>   Components: ODMG-API
>     Versions: 1.0.3
>  Environment: ALL
>     Reporter: Eric Ferrer
>  Attachments: JdbcTypesHelper.java
>
> We are using the BFILE type in Oracle and  org.apache.ojb.broker.util.JdbcTypesHelper.java does not support BFILE.  We have added the support for BFILE in this class but we would like it to be standardize in OJB.  This would make the upgrading to different ojb builds a lot easier.
> Thanks.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


[jira] Closed: (OJB-80) OJB support of Oracle's bfile attribute

Posted by "Armin Waibel (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OJB-80?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Armin Waibel closed OJB-80.
---------------------------

       Resolution: Won't Fix
    Fix Version/s: 1.0.5

Hi Eric,


We can't include code with references to Oracle classes.

I think the easiest way is to add the BFILE type at runtime using JdbcTypesHelper.setJdbcType(String typeName, int typeIndex, JdbcType type). With 'typeIndex' set to value different from java.sql.Types type values.

regards,
Armin


> OJB support of Oracle's bfile attribute
> ---------------------------------------
>
>                 Key: OJB-80
>                 URL: https://issues.apache.org/jira/browse/OJB-80
>             Project: OJB
>          Issue Type: Bug
>          Components: ODMG-API
>    Affects Versions: 1.0.3
>         Environment: ALL
>            Reporter: Eric Ferrer
>             Fix For: 1.0.5
>
>         Attachments: JdbcTypesHelper.java
>
>
> We are using the BFILE type in Oracle and  org.apache.ojb.broker.util.JdbcTypesHelper.java does not support BFILE.  We have added the support for BFILE in this class but we would like it to be standardize in OJB.  This would make the upgrading to different ojb builds a lot easier.
> Thanks.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org