Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Developing Analytics Applications
Custom ODA DataSet getting ResultSet columns by name not position
Migrateduser
<p>Good morning,</p>
<p>
For a task I am working on we am trying to use a custom ODA Data Source and Data Set. The connections appear to be set up properly as we are able to generate results using our code. The issue we're having, though, is we would like to have the flexibility to reference columns in the <strong>ResultSet</strong> by their <strong>name </strong>and <span><em>not</em></span> by their <span>position</span>. After extensive debugging and a myriad of searches I'm still unable to avoid using the ResultSet column's position. This is likely something very simple that maybe I have missed because the documentation states that <strong>position</strong> is an <em>optional</em> property which is only used when the DataSet does not specify that it supports referencing ResultSet columns by name.<br><br>
So my question is: How do I specify that an ODA Data Set should <strong>use column names</strong> and <strong>not use position</strong>?<br><br>
Use case: We have queries that we're trying to reuse. While ideally the query would be modified to only return the columns needed there are cases where a query might return 3 columns and for a chart we only need 2 of those three columns: column #1 and column #3.<br><br>
Mitigation Strategy: We can manually provide information about which columns are provided by the query and programmatically update the position elements for the columns we care about. This is not ideal.<br><br>
Things we've tried:<br>
</p>
<ul class="bbc"><li>We are using Eclipse Mars 1 with BIRT 4.5</li>
<li>We're using the <strong>org.eclipse.datatools.connectivity.oda.dataSource extension</strong> point</li>
<li>In that extension we have specified a dataSource and a dataSet</li>
<li>Our dataSet has a number of dataTypeMappings.</li>
<li>We have a connection profile set up using the <strong>org.eclipse.datatools.connectivity.connectionProfile</strong> extension point</li>
<li>Our queries are provided in to the ODA Data Set using the <strong>queryText</strong> property.</li>
<li>We've tried use of cachedMetaData as well as removal of cachedMetaData from the dataSet in the Report Design file.</li>
<li>We've tried removal of the position property in the resultSet propery (which results in a NullPointerException because position cannot be null) as well as trying position = 0</li>
<li>name and nativeName properties are set in resultSet. nativeDataType is also set.</li>
<li>columnHints are set but not resultHints, is this an issue?</li>
<li>We've tried making our Query implementation extend both IQuery and IAdvancedQuery and tried using named Result Sets.</li>
</ul><br><p>Essentially I'm wondering if there's a property on the Data Set extension that maybe I missed, or if the internal PreparedStatement just doesn't use column names (only our ResultSet#getValue(int) methods are called, not ResultSet#getValue(String)), or if there's a property that sould be set on oda-data-set in the Report Design document to make it use column names and <strong>ignore</strong> the position attribute.<br><br>
Thank you very much for your time.</p>
<p> </p>
<p> </p>
<p> </p>
<p>(this is a copy and paste from the Eclipse BIRT forum where the question is currently unanswered, I hope that is Okay)</p>
Find more posts tagged with
Comments
There are no comments yet