Is it possible to set a jdbc driver at runtime? [message #63755] |
Tue, 02 August 2005 17:51  |
Eclipse User |
|
|
|
1. Can the statically (design-time) configured driver have its init
parameters configured at runtime? (ie. set the connection URL, user id,
password, etc. at runtime)
2. Can the driver class itself also be dynamically configured at runtime?
Thanks.
Marko.
..
|
|
|
Re: Is it possible to set a jdbc driver at runtime? [message #64195 is a reply to message #63755] |
Wed, 03 August 2005 16:19  |
Eclipse User |
|
|
|
The answer to both questions is yes. You can use scripting to dynamically
change data source connection properties at runtime. I am copying this
how-to from a previous post by me. Hope this help.
Gary
===
The best way to achieve this is to edit the beforeOpen script of the data
source object to set the runtime information of the data source. To do this,
right click on your JDBC data source and select "Edit Code". In the method
dropdown list, select "beforeOpen". In the code editor, write a script like
this:
extensionProperties.odaUser = "sesame";
extensionProperties.odaPassword = "open";
extensionProperties.odaURL = "jdbc:my_data_source:....";
extensionProperties.odaDriverClass = "com.mycompany.jdbc.Driver";
Refer to the BIRT ROM scripting spec for more information about scripting in
general. The names of the properties that you can set (odaUser, odaPassword,
etc.) are defined by the ODA extension. The BIRT-shipped ODA-JDBC driver
extension recognizes the above 4 properties.
===
"Marko" <mmilicevic@pssd.com> wrote in message
news:dcopq4$s3a$1@news.eclipse.org...
> 1. Can the statically (design-time) configured driver have its init
> parameters configured at runtime? (ie. set the connection URL, user id,
> password, etc. at runtime)
>
> 2. Can the driver class itself also be dynamically configured at runtime?
>
> Thanks.
>
> Marko.
> .
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04404 seconds