Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Set a role in db/use existing db-connection
Set a role in db/use existing db-connection [message #531675] Wed, 05 May 2010 18:18 Go to next message
Klaus Meisl is currently offline Klaus MeislFriend
Messages: 90
Registered: July 2009
Member
Hi,
In my RCP application the user gets a different role which is set on the
database after logging in the application by sql query "SET ROLE xy".
I'm using birt viewer to load reports in an integrated swt browser. Now
I get an error:
detail : org.eclipse.birt.report.engine.api.EngineException: Cannot
execute the statement.
SQL statement does not return a ResultSet object.
SQL error #1: User 'Klaus@000' does not have execute
permission on FUNCTION 'RTE'.'CURRENT_DATABASESERVERTIME'.
So it seems that I don't have permission, though I'd have it in my
application. I guess birt viewer opens a new connection, so my role is
lost. In my application I avoid this by using the same connection which
is only closed on exiting. So, my question is: can I use this connection
(java.sql.Connection) saved in an Java variable with BIRT in some way,
or do I need to set the role on report execution? And if I have to, what
would be the way? Or are there other ways?

Thanks.
Re: Set a role in db/use existing db-connection [message #531700 is a reply to message #531675] Wed, 05 May 2010 20:00 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Klaus,

You may be able to use the driverBridge extension point to do this.
Take a look at the three blog post pointed out in this forum post:
http://www.birt-exchange.org/forum/deploying-integrating-bir t-report-engine-applications/19466-reportengine-jdbc-issue-s as-jdbc-drivers.html#post64064

Jason

On 5/5/2010 2:18 PM, Klaus Meisl wrote:
> Hi,
> In my RCP application the user gets a different role which is set on the
> database after logging in the application by sql query "SET ROLE xy".
> I'm using birt viewer to load reports in an integrated swt browser. Now
> I get an error:
> detail : org.eclipse.birt.report.engine.api.EngineException: Cannot
> execute the statement.
> SQL statement does not return a ResultSet object.
> SQL error #1: User 'Klaus@000' does not have execute
> permission on FUNCTION 'RTE'.'CURRENT_DATABASESERVERTIME'.
> So it seems that I don't have permission, though I'd have it in my
> application. I guess birt viewer opens a new connection, so my role is
> lost. In my application I avoid this by using the same connection which
> is only closed on exiting. So, my question is: can I use this connection
> (java.sql.Connection) saved in an Java variable with BIRT in some way,
> or do I need to set the role on report execution? And if I have to, what
> would be the way? Or are there other ways?
>
> Thanks.
Re: Set a role in db/use existing db-connection [message #531711 is a reply to message #531700] Wed, 05 May 2010 20:50 Go to previous messageGo to next message
Klaus Meisl is currently offline Klaus MeislFriend
Messages: 90
Registered: July 2009
Member
Jason,

thanks.
task.getAppContext().put("OdaJDBCDriverPassInConnection",
this.getConnection());
for my pdf creation works wonderful. Is there anything comparable easy
for WebViewer?

Klaus


Am 05.05.10 22:00, schrieb Jason Weathersby:
> Klaus,
>
> You may be able to use the driverBridge extension point to do this. Take
> a look at the three blog post pointed out in this forum post:
> http://www.birt-exchange.org/forum/deploying-integrating-bir t-report-engine-applications/19466-reportengine-jdbc-issue-s as-jdbc-drivers.html#post64064
>
>
> Jason
>
> On 5/5/2010 2:18 PM, Klaus Meisl wrote:
>> Hi,
>> In my RCP application the user gets a different role which is set on the
>> database after logging in the application by sql query "SET ROLE xy".
>> I'm using birt viewer to load reports in an integrated swt browser. Now
>> I get an error:
>> detail : org.eclipse.birt.report.engine.api.EngineException: Cannot
>> execute the statement.
>> SQL statement does not return a ResultSet object.
>> SQL error #1: User 'Klaus@000' does not have execute
>> permission on FUNCTION 'RTE'.'CURRENT_DATABASESERVERTIME'.
>> So it seems that I don't have permission, though I'd have it in my
>> application. I guess birt viewer opens a new connection, so my role is
>> lost. In my application I avoid this by using the same connection which
>> is only closed on exiting. So, my question is: can I use this connection
>> (java.sql.Connection) saved in an Java variable with BIRT in some way,
>> or do I need to set the role on report execution? And if I have to, what
>> would be the way? Or are there other ways?
>>
>> Thanks.
>
Re: Set a role in db/use existing db-connection [message #532014 is a reply to message #531711] Thu, 06 May 2010 18:42 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

You could always do in script, like in the beforeOpen:

reportContext.getAppContext().put( .... //You will need some way to
locate your connection );

You may also want to look at this wiki entry:

http://wiki.eclipse.org/Adding_an_Object_to_the_Application_ Context_for_the_Viewer_%28BIRT%29

Jason


On 5/5/2010 4:50 PM, Klaus Meisl wrote:
> Jason,
>
> thanks.
> task.getAppContext().put("OdaJDBCDriverPassInConnection",
> this.getConnection());
> for my pdf creation works wonderful. Is there anything comparable easy
> for WebViewer?
>
> Klaus
>
>
> Am 05.05.10 22:00, schrieb Jason Weathersby:
>> Klaus,
>>
>> You may be able to use the driverBridge extension point to do this. Take
>> a look at the three blog post pointed out in this forum post:
>> http://www.birt-exchange.org/forum/deploying-integrating-bir t-report-engine-applications/19466-reportengine-jdbc-issue-s as-jdbc-drivers.html#post64064
>>
>>
>> Jason
>>
>> On 5/5/2010 2:18 PM, Klaus Meisl wrote:
>>> Hi,
>>> In my RCP application the user gets a different role which is set on the
>>> database after logging in the application by sql query "SET ROLE xy".
>>> I'm using birt viewer to load reports in an integrated swt browser. Now
>>> I get an error:
>>> detail : org.eclipse.birt.report.engine.api.EngineException: Cannot
>>> execute the statement.
>>> SQL statement does not return a ResultSet object.
>>> SQL error #1: User 'Klaus@000' does not have execute
>>> permission on FUNCTION 'RTE'.'CURRENT_DATABASESERVERTIME'.
>>> So it seems that I don't have permission, though I'd have it in my
>>> application. I guess birt viewer opens a new connection, so my role is
>>> lost. In my application I avoid this by using the same connection which
>>> is only closed on exiting. So, my question is: can I use this connection
>>> (java.sql.Connection) saved in an Java variable with BIRT in some way,
>>> or do I need to set the role on report execution? And if I have to, what
>>> would be the way? Or are there other ways?
>>>
>>> Thanks.
>>
>
Re: Set a role in db/use existing db-connection [message #533220 is a reply to message #531711] Wed, 12 May 2010 15:13 Go to previous messageGo to next message
Klaus Meisl is currently offline Klaus MeislFriend
Messages: 90
Registered: July 2009
Member
It seems BIRT closes the connection after running the report. Can I
avoid this?

Am 05.05.10 22:50, schrieb Klaus Meisl:
> Jason,
>
> thanks.
> task.getAppContext().put("OdaJDBCDriverPassInConnection",
> this.getConnection());
> for my pdf creation works wonderful. Is there anything comparable easy
> for WebViewer?
>
> Klaus
>
>
> Am 05.05.10 22:00, schrieb Jason Weathersby:
>> Klaus,
>>
>> You may be able to use the driverBridge extension point to do this. Take
>> a look at the three blog post pointed out in this forum post:
>> http://www.birt-exchange.org/forum/deploying-integrating-bir t-report-engine-applications/19466-reportengine-jdbc-issue-s as-jdbc-drivers.html#post64064
>>
>>
>> Jason
>>
>> On 5/5/2010 2:18 PM, Klaus Meisl wrote:
>>> Hi,
>>> In my RCP application the user gets a different role which is set on the
>>> database after logging in the application by sql query "SET ROLE xy".
>>> I'm using birt viewer to load reports in an integrated swt browser. Now
>>> I get an error:
>>> detail : org.eclipse.birt.report.engine.api.EngineException: Cannot
>>> execute the statement.
>>> SQL statement does not return a ResultSet object.
>>> SQL error #1: User 'Klaus@000' does not have execute
>>> permission on FUNCTION 'RTE'.'CURRENT_DATABASESERVERTIME'.
>>> So it seems that I don't have permission, though I'd have it in my
>>> application. I guess birt viewer opens a new connection, so my role is
>>> lost. In my application I avoid this by using the same connection which
>>> is only closed on exiting. So, my question is: can I use this connection
>>> (java.sql.Connection) saved in an Java variable with BIRT in some way,
>>> or do I need to set the role on report execution? And if I have to, what
>>> would be the way? Or are there other ways?
>>>
>>> Thanks.
>>
>
Re: Set a role in db/use existing db-connection [message #533229 is a reply to message #533220] Wed, 12 May 2010 15:41 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Yes. Use the app context setting:
OdaJDBCDriverPassInConnectionCloseAfterUse
set it to false.

Jason

On 5/12/2010 11:13 AM, Klaus Meisl wrote:
> It seems BIRT closes the connection after running the report. Can I
> avoid this?
>
> Am 05.05.10 22:50, schrieb Klaus Meisl:
>> Jason,
>>
>> thanks.
>> task.getAppContext().put("OdaJDBCDriverPassInConnection",
>> this.getConnection());
>> for my pdf creation works wonderful. Is there anything comparable easy
>> for WebViewer?
>>
>> Klaus
>>
>>
>> Am 05.05.10 22:00, schrieb Jason Weathersby:
>>> Klaus,
>>>
>>> You may be able to use the driverBridge extension point to do this. Take
>>> a look at the three blog post pointed out in this forum post:
>>> http://www.birt-exchange.org/forum/deploying-integrating-bir t-report-engine-applications/19466-reportengine-jdbc-issue-s as-jdbc-drivers.html#post64064
>>>
>>>
>>> Jason
>>>
>>> On 5/5/2010 2:18 PM, Klaus Meisl wrote:
>>>> Hi,
>>>> In my RCP application the user gets a different role which is set on the
>>>> database after logging in the application by sql query "SET ROLE xy".
>>>> I'm using birt viewer to load reports in an integrated swt browser. Now
>>>> I get an error:
>>>> detail : org.eclipse.birt.report.engine.api.EngineException: Cannot
>>>> execute the statement.
>>>> SQL statement does not return a ResultSet object.
>>>> SQL error #1: User 'Klaus@000' does not have execute
>>>> permission on FUNCTION 'RTE'.'CURRENT_DATABASESERVERTIME'.
>>>> So it seems that I don't have permission, though I'd have it in my
>>>> application. I guess birt viewer opens a new connection, so my role is
>>>> lost. In my application I avoid this by using the same connection which
>>>> is only closed on exiting. So, my question is: can I use this connection
>>>> (java.sql.Connection) saved in an Java variable with BIRT in some way,
>>>> or do I need to set the role on report execution? And if I have to, what
>>>> would be the way? Or are there other ways?
>>>>
>>>> Thanks.
>>>
>>
>
Re: Set a role in db/use existing db-connection [message #533390 is a reply to message #533229] Thu, 13 May 2010 16:01 Go to previous messageGo to next message
Klaus Meisl is currently offline Klaus MeislFriend
Messages: 90
Registered: July 2009
Member
I tried
task.getAppContext().put("OdaJDBCDriverPassInConnectionCloseAfterUse ",
false);
and
task.getAppContext().put("OdaJDBCDriverPassInConnectionCloseAfterUse ",
"false");
but I always get
java.sql.SQLNonTransientConnectionException: No current connection.
when I want to create the second report.


Am 12.05.10 17:41, schrieb Jason Weathersby:
> Yes. Use the app context setting:
> OdaJDBCDriverPassInConnectionCloseAfterUse
> set it to false.
>
> Jason
>
> On 5/12/2010 11:13 AM, Klaus Meisl wrote:
>> It seems BIRT closes the connection after running the report. Can I
>> avoid this?
>>
>> Am 05.05.10 22:50, schrieb Klaus Meisl:
>>> Jason,
>>>
>>> thanks.
>>> task.getAppContext().put("OdaJDBCDriverPassInConnection",
>>> this.getConnection());
>>> for my pdf creation works wonderful. Is there anything comparable easy
>>> for WebViewer?
>>>
>>> Klaus
>>>
>>>
>>> Am 05.05.10 22:00, schrieb Jason Weathersby:
>>>> Klaus,
>>>>
>>>> You may be able to use the driverBridge extension point to do this.
>>>> Take
>>>> a look at the three blog post pointed out in this forum post:
>>>> http://www.birt-exchange.org/forum/deploying-integrating-bir t-report-engine-applications/19466-reportengine-jdbc-issue-s as-jdbc-drivers.html#post64064
>>>>
>>>>
>>>>
>>>> Jason
>>>>
>>>> On 5/5/2010 2:18 PM, Klaus Meisl wrote:
>>>>> Hi,
>>>>> In my RCP application the user gets a different role which is set
>>>>> on the
>>>>> database after logging in the application by sql query "SET ROLE xy".
>>>>> I'm using birt viewer to load reports in an integrated swt browser.
>>>>> Now
>>>>> I get an error:
>>>>> detail : org.eclipse.birt.report.engine.api.EngineException: Cannot
>>>>> execute the statement.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: User 'Klaus@000' does not have execute
>>>>> permission on FUNCTION 'RTE'.'CURRENT_DATABASESERVERTIME'.
>>>>> So it seems that I don't have permission, though I'd have it in my
>>>>> application. I guess birt viewer opens a new connection, so my role is
>>>>> lost. In my application I avoid this by using the same connection
>>>>> which
>>>>> is only closed on exiting. So, my question is: can I use this
>>>>> connection
>>>>> (java.sql.Connection) saved in an Java variable with BIRT in some way,
>>>>> or do I need to set the role on report execution? And if I have to,
>>>>> what
>>>>> would be the way? Or are there other ways?
>>>>>
>>>>> Thanks.
>>>>
>>>
>>
>
Re: Set a role in db/use existing db-connection [message #533401 is a reply to message #533390] Thu, 13 May 2010 16:21 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Klaus,

Either of those should have worked. Can you download the source for the
jdbc plugin and debug it?

Jason

On 5/13/2010 12:01 PM, Klaus Meisl wrote:
> I tried
> task.getAppContext().put("OdaJDBCDriverPassInConnectionCloseAfterUse ",
> false);
> and
> task.getAppContext().put("OdaJDBCDriverPassInConnectionCloseAfterUse ",
> "false");
> but I always get
> java.sql.SQLNonTransientConnectionException: No current connection.
> when I want to create the second report.
>
>
> Am 12.05.10 17:41, schrieb Jason Weathersby:
>> Yes. Use the app context setting:
>> OdaJDBCDriverPassInConnectionCloseAfterUse
>> set it to false.
>>
>> Jason
>>
>> On 5/12/2010 11:13 AM, Klaus Meisl wrote:
>>> It seems BIRT closes the connection after running the report. Can I
>>> avoid this?
>>>
>>> Am 05.05.10 22:50, schrieb Klaus Meisl:
>>>> Jason,
>>>>
>>>> thanks.
>>>> task.getAppContext().put("OdaJDBCDriverPassInConnection",
>>>> this.getConnection());
>>>> for my pdf creation works wonderful. Is there anything comparable easy
>>>> for WebViewer?
>>>>
>>>> Klaus
>>>>
>>>>
>>>> Am 05.05.10 22:00, schrieb Jason Weathersby:
>>>>> Klaus,
>>>>>
>>>>> You may be able to use the driverBridge extension point to do this.
>>>>> Take
>>>>> a look at the three blog post pointed out in this forum post:
>>>>> http://www.birt-exchange.org/forum/deploying-integrating-bir t-report-engine-applications/19466-reportengine-jdbc-issue-s as-jdbc-drivers.html#post64064
>>>>>
>>>>>
>>>>>
>>>>> Jason
>>>>>
>>>>> On 5/5/2010 2:18 PM, Klaus Meisl wrote:
>>>>>> Hi,
>>>>>> In my RCP application the user gets a different role which is set
>>>>>> on the
>>>>>> database after logging in the application by sql query "SET ROLE xy".
>>>>>> I'm using birt viewer to load reports in an integrated swt browser.
>>>>>> Now
>>>>>> I get an error:
>>>>>> detail : org.eclipse.birt.report.engine.api.EngineException: Cannot
>>>>>> execute the statement.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: User 'Klaus@000' does not have execute
>>>>>> permission on FUNCTION 'RTE'.'CURRENT_DATABASESERVERTIME'.
>>>>>> So it seems that I don't have permission, though I'd have it in my
>>>>>> application. I guess birt viewer opens a new connection, so my role is
>>>>>> lost. In my application I avoid this by using the same connection
>>>>>> which
>>>>>> is only closed on exiting. So, my question is: can I use this
>>>>>> connection
>>>>>> (java.sql.Connection) saved in an Java variable with BIRT in some way,
>>>>>> or do I need to set the role on report execution? And if I have to,
>>>>>> what
>>>>>> would be the way? Or are there other ways?
>>>>>>
>>>>>> Thanks.
>>>>>
>>>>
>>>
>>
>
Re: Set a role in db/use existing db-connection [message #533402 is a reply to message #533401] Thu, 13 May 2010 16:40 Go to previous messageGo to next message
Klaus Meisl is currently offline Klaus MeislFriend
Messages: 90
Registered: July 2009
Member
Thanks Jason, you're the best!
It was my fault, I accidently closed the connection with close() and did
miss it on reviewing my code.
Klaus

Am 13.05.10 18:21, schrieb Jason Weathersby:
> Klaus,
>
> Either of those should have worked. Can you download the source for the
> jdbc plugin and debug it?
>
> Jason
>
> On 5/13/2010 12:01 PM, Klaus Meisl wrote:
>> I tried
>> task.getAppContext().put("OdaJDBCDriverPassInConnectionCloseAfterUse ",
>> false);
>> and
>> task.getAppContext().put("OdaJDBCDriverPassInConnectionCloseAfterUse ",
>> "false");
>> but I always get
>> java.sql.SQLNonTransientConnectionException: No current connection.
>> when I want to create the second report.
>>
>>
>> Am 12.05.10 17:41, schrieb Jason Weathersby:
>>> Yes. Use the app context setting:
>>> OdaJDBCDriverPassInConnectionCloseAfterUse
>>> set it to false.
>>>
>>> Jason
>>>
>>> On 5/12/2010 11:13 AM, Klaus Meisl wrote:
>>>> It seems BIRT closes the connection after running the report. Can I
>>>> avoid this?
>>>>
>>>> Am 05.05.10 22:50, schrieb Klaus Meisl:
>>>>> Jason,
>>>>>
>>>>> thanks.
>>>>> task.getAppContext().put("OdaJDBCDriverPassInConnection",
>>>>> this.getConnection());
>>>>> for my pdf creation works wonderful. Is there anything comparable easy
>>>>> for WebViewer?
>>>>>
>>>>> Klaus
>>>>>
>>>>>
>>>>> Am 05.05.10 22:00, schrieb Jason Weathersby:
>>>>>> Klaus,
>>>>>>
>>>>>> You may be able to use the driverBridge extension point to do this.
>>>>>> Take
>>>>>> a look at the three blog post pointed out in this forum post:
>>>>>> http://www.birt-exchange.org/forum/deploying-integrating-bir t-report-engine-applications/19466-reportengine-jdbc-issue-s as-jdbc-drivers.html#post64064
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Jason
>>>>>>
>>>>>> On 5/5/2010 2:18 PM, Klaus Meisl wrote:
>>>>>>> Hi,
>>>>>>> In my RCP application the user gets a different role which is set
>>>>>>> on the
>>>>>>> database after logging in the application by sql query "SET ROLE
>>>>>>> xy".
>>>>>>> I'm using birt viewer to load reports in an integrated swt browser.
>>>>>>> Now
>>>>>>> I get an error:
>>>>>>> detail : org.eclipse.birt.report.engine.api.EngineException: Cannot
>>>>>>> execute the statement.
>>>>>>> SQL statement does not return a ResultSet object.
>>>>>>> SQL error #1: User 'Klaus@000' does not have execute
>>>>>>> permission on FUNCTION 'RTE'.'CURRENT_DATABASESERVERTIME'.
>>>>>>> So it seems that I don't have permission, though I'd have it in my
>>>>>>> application. I guess birt viewer opens a new connection, so my
>>>>>>> role is
>>>>>>> lost. In my application I avoid this by using the same connection
>>>>>>> which
>>>>>>> is only closed on exiting. So, my question is: can I use this
>>>>>>> connection
>>>>>>> (java.sql.Connection) saved in an Java variable with BIRT in some
>>>>>>> way,
>>>>>>> or do I need to set the role on report execution? And if I have to,
>>>>>>> what
>>>>>>> would be the way? Or are there other ways?
>>>>>>>
>>>>>>> Thanks.
>>>>>>
>>>>>
>>>>
>>>
>>
>
Re: Set a role in db/use existing db-connection [message #533403 is a reply to message #533402] Thu, 13 May 2010 16:55 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Glad to hear you got it working.

On 5/13/2010 12:40 PM, Klaus Meisl wrote:
> Thanks Jason, you're the best!
> It was my fault, I accidently closed the connection with close() and did
> miss it on reviewing my code.
> Klaus
>
> Am 13.05.10 18:21, schrieb Jason Weathersby:
>> Klaus,
>>
>> Either of those should have worked. Can you download the source for the
>> jdbc plugin and debug it?
>>
>> Jason
>>
>> On 5/13/2010 12:01 PM, Klaus Meisl wrote:
>>> I tried
>>> task.getAppContext().put("OdaJDBCDriverPassInConnectionCloseAfterUse ",
>>> false);
>>> and
>>> task.getAppContext().put("OdaJDBCDriverPassInConnectionCloseAfterUse ",
>>> "false");
>>> but I always get
>>> java.sql.SQLNonTransientConnectionException: No current connection.
>>> when I want to create the second report.
>>>
>>>
>>> Am 12.05.10 17:41, schrieb Jason Weathersby:
>>>> Yes. Use the app context setting:
>>>> OdaJDBCDriverPassInConnectionCloseAfterUse
>>>> set it to false.
>>>>
>>>> Jason
>>>>
>>>> On 5/12/2010 11:13 AM, Klaus Meisl wrote:
>>>>> It seems BIRT closes the connection after running the report. Can I
>>>>> avoid this?
>>>>>
>>>>> Am 05.05.10 22:50, schrieb Klaus Meisl:
>>>>>> Jason,
>>>>>>
>>>>>> thanks.
>>>>>> task.getAppContext().put("OdaJDBCDriverPassInConnection",
>>>>>> this.getConnection());
>>>>>> for my pdf creation works wonderful. Is there anything comparable easy
>>>>>> for WebViewer?
>>>>>>
>>>>>> Klaus
>>>>>>
>>>>>>
>>>>>> Am 05.05.10 22:00, schrieb Jason Weathersby:
>>>>>>> Klaus,
>>>>>>>
>>>>>>> You may be able to use the driverBridge extension point to do this.
>>>>>>> Take
>>>>>>> a look at the three blog post pointed out in this forum post:
>>>>>>> http://www.birt-exchange.org/forum/deploying-integrating-bir t-report-engine-applications/19466-reportengine-jdbc-issue-s as-jdbc-drivers.html#post64064
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Jason
>>>>>>>
>>>>>>> On 5/5/2010 2:18 PM, Klaus Meisl wrote:
>>>>>>>> Hi,
>>>>>>>> In my RCP application the user gets a different role which is set
>>>>>>>> on the
>>>>>>>> database after logging in the application by sql query "SET ROLE
>>>>>>>> xy".
>>>>>>>> I'm using birt viewer to load reports in an integrated swt browser.
>>>>>>>> Now
>>>>>>>> I get an error:
>>>>>>>> detail : org.eclipse.birt.report.engine.api.EngineException: Cannot
>>>>>>>> execute the statement.
>>>>>>>> SQL statement does not return a ResultSet object.
>>>>>>>> SQL error #1: User 'Klaus@000' does not have execute
>>>>>>>> permission on FUNCTION 'RTE'.'CURRENT_DATABASESERVERTIME'.
>>>>>>>> So it seems that I don't have permission, though I'd have it in my
>>>>>>>> application. I guess birt viewer opens a new connection, so my
>>>>>>>> role is
>>>>>>>> lost. In my application I avoid this by using the same connection
>>>>>>>> which
>>>>>>>> is only closed on exiting. So, my question is: can I use this
>>>>>>>> connection
>>>>>>>> (java.sql.Connection) saved in an Java variable with BIRT in some
>>>>>>>> way,
>>>>>>>> or do I need to set the role on report execution? And if I have to,
>>>>>>>> what
>>>>>>>> would be the way? Or are there other ways?
>>>>>>>>
>>>>>>>> Thanks.
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>
Re: Set a role in db/use existing db-connection [message #533436 is a reply to message #532014] Thu, 13 May 2010 21:28 Go to previous message
Klaus Meisl is currently offline Klaus MeislFriend
Messages: 90
Registered: July 2009
Member
For other interested people: I solved it by using a AppContext Class
described in Jason's post here:
http://www.birt-exchange.org/forum/deploying-integrating-bir t-report-engine-applications/13317-launching-webviewer-code. html#post42380
I just added "hm.put("OdaJDBCDriverPassInConnection",
Application.getConnection());", that was it.


Am 06.05.10 20:42, schrieb Jason Weathersby:
> You could always do in script, like in the beforeOpen:
>
> reportContext.getAppContext().put( .... //You will need some way to
> locate your connection );
>
> You may also want to look at this wiki entry:
>
> http://wiki.eclipse.org/Adding_an_Object_to_the_Application_ Context_for_the_Viewer_%28BIRT%29
>
>
> Jason
>
>
> On 5/5/2010 4:50 PM, Klaus Meisl wrote:
>> Jason,
>>
>> thanks.
>> task.getAppContext().put("OdaJDBCDriverPassInConnection",
>> this.getConnection());
>> for my pdf creation works wonderful. Is there anything comparable easy
>> for WebViewer?
>>
>> Klaus
>>
>>
>> Am 05.05.10 22:00, schrieb Jason Weathersby:
>>> Klaus,
>>>
>>> You may be able to use the driverBridge extension point to do this. Take
>>> a look at the three blog post pointed out in this forum post:
>>> http://www.birt-exchange.org/forum/deploying-integrating-bir t-report-engine-applications/19466-reportengine-jdbc-issue-s as-jdbc-drivers.html#post64064
>>>
>>>
>>>
>>> Jason
>>>
>>> On 5/5/2010 2:18 PM, Klaus Meisl wrote:
>>>> Hi,
>>>> In my RCP application the user gets a different role which is set on
>>>> the
>>>> database after logging in the application by sql query "SET ROLE xy".
>>>> I'm using birt viewer to load reports in an integrated swt browser. Now
>>>> I get an error:
>>>> detail : org.eclipse.birt.report.engine.api.EngineException: Cannot
>>>> execute the statement.
>>>> SQL statement does not return a ResultSet object.
>>>> SQL error #1: User 'Klaus@000' does not have execute
>>>> permission on FUNCTION 'RTE'.'CURRENT_DATABASESERVERTIME'.
>>>> So it seems that I don't have permission, though I'd have it in my
>>>> application. I guess birt viewer opens a new connection, so my role is
>>>> lost. In my application I avoid this by using the same connection which
>>>> is only closed on exiting. So, my question is: can I use this
>>>> connection
>>>> (java.sql.Connection) saved in an Java variable with BIRT in some way,
>>>> or do I need to set the role on report execution? And if I have to,
>>>> what
>>>> would be the way? Or are there other ways?
>>>>
>>>> Thanks.
>>>
>>
>
Previous Topic:Parameter Mapping
Next Topic:Joint Data Set in Library
Goto Forum:
  


Current Time: Thu Apr 25 16:38:29 GMT 2024

Powered by FUDForum. Page generated in 0.03523 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top