Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
DEAPI - Create new POJO Datasource
jhelbling_reportingsoft
<p>Hi,</p>
<p> </p>
<p>Using 4.4.2, I'm trying to dynamically create a POJO Data Source using the following code :</p>
<pre class="_prettyXprint">
OdaDataSourceHandle dsHandle = null;
try {
dsHandle = efactory.newOdaDataSource("pojoDataSource", "org.eclipse.birt.data.oda.pojo");
dsHandle.setProperty("SynchronizeClassPath", "false");
dsHandle.setProperty("pojoClassPath", "/path/to/my/jar;");
} catch (SemanticException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
</pre>
<p>But I'm currently getting the following exception :</p>
<pre class="_prettyXprint _lang-nocode">
org.eclipse.birt.report.model.api.command.PropertyNameException: The property "SynchronizeClassPath" is invalid for element "pojoDataSource".
</pre>
<p>However, I checked and this property is present when designing a new POJO Data Source using the Designer. Also, if I don't set this property, I'm getting the exact same error bur for the next property ... (pojoClassPath).</p>
<p> </p>
<p>What am I doing wrong, should I query the Factory for another type of object ?</p>
<p> </p>
<p>Thanks !</p>
Find more posts tagged with
Comments
jhelbling_reportingsoft
<p>Ok ... my bad ... I was using the wrong methods since these properties are private, but accessible ...</p>
<p> </p>
<p>The following is much better :</p>
<pre class="_prettyXprint _lang-">
dsHandle.setPrivateDriverProperty("SynchronizeClassPath", "false");
dsHandle.setPrivateDriverProperty("pojoClassPath", "/path/to/my/jar;");
</pre>