Home » Archived » BIRT » 2.0 DB Image Support
2.0 DB Image Support [message #124869] |
Mon, 06 February 2006 12:12  |
Eclipse User |
|
|
|
Hello, I just pulled the latest Birt 2.0 Release and I was disappointed to
notice that the image support was still not working. Although blob support
has been added, it isn't compatible with the different databases. In
postgres, blob support is limited and mostly unneccessary b/c of the bytea
datatype. This causes a problem b/c birt is calling getBlob() in the jdbc
driver for bytea columns. I'm going to patch birt again so that it
supports bytea columns and remap the oda.jdbc plugin xml package for the
appropriate columns. Anyone else encountered this problem? Otherwise, the
birt 2.0 release looks great. Many great fixes. I think the fop removal
was excellent. Itext seems to be much much faster. A couple of other
questions I have -
why did all of the column names mysteriously get converted to lowercase,
e.g.
- in birt 1.1: row["myColumn"] works, but in 2.0 it must be row["mycolumn"]
regardless of the sql query.
- on two exact installs, the same report works on one, but not on the other
( I have yet to investigate this, maybe not an issue)
The rest looks excellent, MUch more informative errors, love the ability to
name elements to allow isolation of errors for faster debugging.
Thanks,
Joe
|
|
|
Re: 2.0 DB Image Support [message #124932 is a reply to message #124869] |
Mon, 06 February 2006 16:14   |
Eclipse User |
|
|
|
Joe,
Can you file a bugzilla bug about the problem you encountered with Blob and
postgres?
About the letter case of the column names: BIRT uses whatever column name
that the JDBC driver reports in its metadata to identify the column. As of
BIRT 2.0 column names are treated as case sensitive. If the jdbc driver
returns all column names in all lower case, you will need to use lower case
in the "row" expression as well.
regards,
--
Gary Xue
Actuate Corporation - Product Development
BIRT Committer
"Joe Rybacki" <Joe.Rybacki@dynetics.com> wrote in message
news:ds802p$te3$1@utils.eclipse.org...
> Hello, I just pulled the latest Birt 2.0 Release and I was disappointed to
> notice that the image support was still not working. Although blob
support
> has been added, it isn't compatible with the different databases. In
> postgres, blob support is limited and mostly unneccessary b/c of the bytea
> datatype. This causes a problem b/c birt is calling getBlob() in the jdbc
> driver for bytea columns. I'm going to patch birt again so that it
> supports bytea columns and remap the oda.jdbc plugin xml package for the
> appropriate columns. Anyone else encountered this problem? Otherwise,
the
> birt 2.0 release looks great. Many great fixes. I think the fop removal
> was excellent. Itext seems to be much much faster. A couple of other
> questions I have -
>
> why did all of the column names mysteriously get converted to lowercase,
> e.g.
>
> - in birt 1.1: row["myColumn"] works, but in 2.0 it must be
row["mycolumn"]
> regardless of the sql query.
> - on two exact installs, the same report works on one, but not on the
other
> ( I have yet to investigate this, maybe not an issue)
>
> The rest looks excellent, MUch more informative errors, love the ability
to
> name elements to allow isolation of errors for faster debugging.
>
> Thanks,
> Joe
>
>
|
|
|
Re: 2.0 DB Image Support [message #124958 is a reply to message #124932] |
Mon, 06 February 2006 17:03   |
Eclipse User |
|
|
|
Thanks for the fast response Gary. I figured out what the problem was:
1. in the image element there needs to be a way to specify the typeExpr
property, e.g.
<image id="6">
<property name="dataSet">picture</property>
<expression name="typeExpr">row["mt_type"]</expression>
<expression name="valueExpr">row["data"]</expression>
</image>
2. To support drivers that do blobs via byte array e.g Postgres the
getBlob() methods of
org.eclipse.birt.report.data.oda.jdbc.ResultSet need to be changed to look
like:
/*
* (non-Javadoc)
*
* @see
org.eclipse.datatools.connectivity.oda.IAdvancedQuery#getBlo b(java.lang.String)
*/
public IBlob getBlob(String columnName) throws OdaException {
assertNotNull(rs);
try {
java.sql.Blob blob = rs.getBlob(columnName);
return new Blob(blob);
}
// especially for MS Access, which does not support getBlob method
catch (UnsupportedOperationException e1) {
try {
InputStream inputStream = rs.getBinaryStream(columnName);
return new Blob(SqlBlobUtil.newBlob(inputStream));
} catch (SQLException e2) {
throw new JDBCException(
ResourceConstants.RESULTSET_CANNOT_GET_BLOB_VALUE, e2);
}
} catch (SQLException e) {
// try using get bytes/
try {
byte[] bytes = rs.getBytes(columnName);
return new Blob(SqlBlobUtil.newBlob(new ByteArrayInputStream(
bytes)));
} catch (SQLException e2) {
throw new JDBCException(
ResourceConstants.RESULTSET_CANNOT_GET_BLOB_VALUE, e2);
}
}
}
/*
* (non-Javadoc)
*
* @see org.eclipse.datatools.connectivity.oda.IAdvancedQuery#getBlo b(int)
*/
public IBlob getBlob(int index) throws OdaException {
assertNotNull(rs);
try {
java.sql.Blob blob = rs.getBlob(index);
return new Blob(blob);
}
// especially for MS Access, which does not support getBlob method
catch (UnsupportedOperationException e1) {
try {
InputStream inputStream = rs.getBinaryStream(index);
return new Blob(SqlBlobUtil.newBlob(inputStream));
} catch (SQLException e2) {
throw new JDBCException(
ResourceConstants.RESULTSET_CANNOT_GET_BLOB_VALUE, e2);
}
} catch (SQLException e) {
// try using get bytes/
try {
byte[] bytes = rs.getBytes(index);
return new Blob(SqlBlobUtil.newBlob(new ByteArrayInputStream(
bytes)));
} catch (SQLException e2) {
throw new JDBCException(
ResourceConstants.RESULTSET_CANNOT_GET_BLOB_VALUE, e2);
}
}
}
This way they'll try the getBytes if getBlob doesn't work.
Thanks for your help, Birt 2.0 is a great improvement, we just added charts
and it took no time at all.
Thanks,
Joe
"Gary Xue" <gxue@actuate.com> wrote in message
news:ds8e5c$3u2$1@utils.eclipse.org...
> Joe,
> Can you file a bugzilla bug about the problem you encountered with Blob
> and
> postgres?
>
> About the letter case of the column names: BIRT uses whatever column name
> that the JDBC driver reports in its metadata to identify the column. As of
> BIRT 2.0 column names are treated as case sensitive. If the jdbc driver
> returns all column names in all lower case, you will need to use lower
> case
> in the "row" expression as well.
>
> regards,
>
> --
> Gary Xue
> Actuate Corporation - Product Development
> BIRT Committer
>
> "Joe Rybacki" <Joe.Rybacki@dynetics.com> wrote in message
> news:ds802p$te3$1@utils.eclipse.org...
>> Hello, I just pulled the latest Birt 2.0 Release and I was disappointed
>> to
>> notice that the image support was still not working. Although blob
> support
>> has been added, it isn't compatible with the different databases. In
>> postgres, blob support is limited and mostly unneccessary b/c of the
>> bytea
>> datatype. This causes a problem b/c birt is calling getBlob() in the
>> jdbc
>> driver for bytea columns. I'm going to patch birt again so that it
>> supports bytea columns and remap the oda.jdbc plugin xml package for the
>> appropriate columns. Anyone else encountered this problem? Otherwise,
> the
>> birt 2.0 release looks great. Many great fixes. I think the fop
>> removal
>> was excellent. Itext seems to be much much faster. A couple of other
>> questions I have -
>>
>> why did all of the column names mysteriously get converted to lowercase,
>> e.g.
>>
>> - in birt 1.1: row["myColumn"] works, but in 2.0 it must be
> row["mycolumn"]
>> regardless of the sql query.
>> - on two exact installs, the same report works on one, but not on the
> other
>> ( I have yet to investigate this, maybe not an issue)
>>
>> The rest looks excellent, MUch more informative errors, love the ability
> to
>> name elements to allow isolation of errors for faster debugging.
>>
>> Thanks,
>> Joe
>>
>>
>
>
|
|
| |
Re: 2.0 DB Image Support [message #170758 is a reply to message #124958] |
Thu, 15 June 2006 15:04  |
Eclipse User |
|
|
|
It doesn't look like a defect ever got logged for this bug; so I
submitted one on your behalf (as I REALLY need this feature):
https://bugs.eclipse.org/bugs/show_bug.cgi?id=147339
Joe Rybacki wrote:
> Thanks for the fast response Gary. I figured out what the problem was:
>
> 1. in the image element there needs to be a way to specify the typeExpr
> property, e.g.
> <image id="6">
>
> <property name="dataSet">picture</property>
>
> <expression name="typeExpr">row["mt_type"]</expression>
>
> <expression name="valueExpr">row["data"]</expression>
>
> </image>
>
> 2. To support drivers that do blobs via byte array e.g Postgres the
> getBlob() methods of
>
> org.eclipse.birt.report.data.oda.jdbc.ResultSet need to be changed to look
> like:
>
> /*
> * (non-Javadoc)
> *
> * @see
> org.eclipse.datatools.connectivity.oda.IAdvancedQuery#getBlo b(java.lang.String)
> */
> public IBlob getBlob(String columnName) throws OdaException {
> assertNotNull(rs);
> try {
> java.sql.Blob blob = rs.getBlob(columnName);
> return new Blob(blob);
> }
> // especially for MS Access, which does not support getBlob method
> catch (UnsupportedOperationException e1) {
> try {
> InputStream inputStream = rs.getBinaryStream(columnName);
> return new Blob(SqlBlobUtil.newBlob(inputStream));
> } catch (SQLException e2) {
> throw new JDBCException(
> ResourceConstants.RESULTSET_CANNOT_GET_BLOB_VALUE, e2);
> }
> } catch (SQLException e) {
> // try using get bytes/
> try {
> byte[] bytes = rs.getBytes(columnName);
> return new Blob(SqlBlobUtil.newBlob(new ByteArrayInputStream(
> bytes)));
> } catch (SQLException e2) {
> throw new JDBCException(
> ResourceConstants.RESULTSET_CANNOT_GET_BLOB_VALUE, e2);
> }
> }
> }
>
> /*
> * (non-Javadoc)
> *
> * @see org.eclipse.datatools.connectivity.oda.IAdvancedQuery#getBlo b(int)
> */
> public IBlob getBlob(int index) throws OdaException {
> assertNotNull(rs);
> try {
> java.sql.Blob blob = rs.getBlob(index);
> return new Blob(blob);
> }
> // especially for MS Access, which does not support getBlob method
> catch (UnsupportedOperationException e1) {
> try {
> InputStream inputStream = rs.getBinaryStream(index);
> return new Blob(SqlBlobUtil.newBlob(inputStream));
> } catch (SQLException e2) {
> throw new JDBCException(
> ResourceConstants.RESULTSET_CANNOT_GET_BLOB_VALUE, e2);
> }
> } catch (SQLException e) {
> // try using get bytes/
> try {
> byte[] bytes = rs.getBytes(index);
> return new Blob(SqlBlobUtil.newBlob(new ByteArrayInputStream(
> bytes)));
> } catch (SQLException e2) {
> throw new JDBCException(
> ResourceConstants.RESULTSET_CANNOT_GET_BLOB_VALUE, e2);
> }
>
> }
> }
>
> This way they'll try the getBytes if getBlob doesn't work.
>
>
>
> Thanks for your help, Birt 2.0 is a great improvement, we just added charts
> and it took no time at all.
>
> Thanks,
>
> Joe
>
> "Gary Xue" <gxue@actuate.com> wrote in message
> news:ds8e5c$3u2$1@utils.eclipse.org...
>> Joe,
>> Can you file a bugzilla bug about the problem you encountered with Blob
>> and
>> postgres?
>>
>> About the letter case of the column names: BIRT uses whatever column name
>> that the JDBC driver reports in its metadata to identify the column. As of
>> BIRT 2.0 column names are treated as case sensitive. If the jdbc driver
>> returns all column names in all lower case, you will need to use lower
>> case
>> in the "row" expression as well.
>>
>> regards,
>>
>> --
>> Gary Xue
>> Actuate Corporation - Product Development
>> BIRT Committer
>>
>> "Joe Rybacki" <Joe.Rybacki@dynetics.com> wrote in message
>> news:ds802p$te3$1@utils.eclipse.org...
>>> Hello, I just pulled the latest Birt 2.0 Release and I was disappointed
>>> to
>>> notice that the image support was still not working. Although blob
>> support
>>> has been added, it isn't compatible with the different databases. In
>>> postgres, blob support is limited and mostly unneccessary b/c of the
>>> bytea
>>> datatype. This causes a problem b/c birt is calling getBlob() in the
>>> jdbc
>>> driver for bytea columns. I'm going to patch birt again so that it
>>> supports bytea columns and remap the oda.jdbc plugin xml package for the
>>> appropriate columns. Anyone else encountered this problem? Otherwise,
>> the
>>> birt 2.0 release looks great. Many great fixes. I think the fop
>>> removal
>>> was excellent. Itext seems to be much much faster. A couple of other
>>> questions I have -
>>>
>>> why did all of the column names mysteriously get converted to lowercase,
>>> e.g.
>>>
>>> - in birt 1.1: row["myColumn"] works, but in 2.0 it must be
>> row["mycolumn"]
>>> regardless of the sql query.
>>> - on two exact installs, the same report works on one, but not on the
>> other
>>> ( I have yet to investigate this, maybe not an issue)
>>>
>>> The rest looks excellent, MUch more informative errors, love the ability
>> to
>>> name elements to allow isolation of errors for faster debugging.
>>>
>>> Thanks,
>>> Joe
>>>
>>>
>>
>
>
|
|
|
Goto Forum:
Current Time: Tue Jul 22 07:38:04 EDT 2025
Powered by FUDForum. Page generated in 0.04613 seconds
|