Return-Path: Delivered-To: apmail-db-ojb-dev-archive@www.apache.org Received: (qmail 97455 invoked from network); 16 Oct 2006 19:25:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Oct 2006 19:25:37 -0000 Received: (qmail 73761 invoked by uid 500); 16 Oct 2006 19:25:36 -0000 Delivered-To: apmail-db-ojb-dev-archive@db.apache.org Received: (qmail 73735 invoked by uid 500); 16 Oct 2006 19:25:36 -0000 Mailing-List: contact ojb-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "OJB Developers List" Reply-To: "OJB Developers List" Delivered-To: mailing list ojb-dev@db.apache.org Received: (qmail 65235 invoked by uid 99); 16 Oct 2006 11:02:27 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Message-ID: <18465108.1160996496181.JavaMail.jira@brutus> Date: Mon, 16 Oct 2006 04:01:36 -0700 (PDT) From: "Armin Waibel (JIRA)" To: ojb-dev@db.apache.org Subject: [jira] Commented: (OJB-80) OJB support of Oracle's bfile attribute In-Reply-To: <205513357.1134070449246.JavaMail.jira@ajax.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ 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