Skip to main content



      Home
Home » Archived » BIRT » datasource password
datasource password [message #90272] Fri, 11 November 2005 13:54 Go to next message
Eclipse UserFriend
Originally posted by: jspsim.yahoo.com

Hi,

is there any way to get the datasource password from a java class. Reason is
that, the production server db password is not made known to us, and the
only we can get it is call a java method which will return the db password.

regards,
kelvin
Re: datasource password [message #90302 is a reply to message #90272] Fri, 11 November 2005 15:24 Go to previous messageGo to next message
Eclipse UserFriend
Kelvin,

From the FAQ
Gary Xue
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";

HTHJason WeathersbyBIRT PMC"Titan" <jspsim@yahoo.com> wrote in message
news:dl2piq$ghf$1@news.eclipse.org...
> Hi,
>
> is there any way to get the datasource password from a java class. Reason
> is that, the production server db password is not made known to us, and
> the only we can get it is call a java method which will return the db
> password.
>
> regards,
> kelvin
>
>
Re: datasource password [message #90398 is a reply to message #90302] Sat, 12 November 2005 01:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jspsim.yahoo.com

jason,

i had tried your mentioned faq method, but the password still needs to be
'hardcoded', which is not possible for my case, as I don't have the
password directly.

I had also tried the other method using:
dbpassword = Packages.java.lang.System.getenv("DB_PW");
extensionProperties.odaPassword = dbpassword + "";

Though it works, but my passwork will not be set in the environments, thus
i modified it to be as follows:
dbpassword = Packages.mypackage.myclass.Decryptor.getPassword();
//<--using my own class
extensionProperties.odaPassword = dbpassword + "";

however, it gives a Invalid Javascript expression. Is there any way I can
called my decryptor class to get the password.

regards,
kelvin
Re: datasource password [message #90412 is a reply to message #90398] Sat, 12 November 2005 01:33 Go to previous message
Eclipse UserFriend
Originally posted by: jspsim.yahoo.com

i realize that though it gives "Invalid javascript expression" during
saving of the template, during the runtime, it still gets the password
from the my Decryptor. So i guess my problems is solved, thanks Jason.

titan wrote:

> jason,

> i had tried your mentioned faq method, but the password still needs to be
> 'hardcoded', which is not possible for my case, as I don't have the
> password directly.

> I had also tried the other method using:
> dbpassword = Packages.java.lang.System.getenv("DB_PW");
> extensionProperties.odaPassword = dbpassword + "";

> Though it works, but my passwork will not be set in the environments, thus
> i modified it to be as follows:
> dbpassword = Packages.mypackage.myclass.Decryptor.getPassword();
> //<--using my own class
> extensionProperties.odaPassword = dbpassword + "";

> however, it gives a Invalid Javascript expression. Is there any way I can
> called my decryptor class to get the password.

> regards,
> kelvin
Previous Topic:Nested lists advice
Next Topic:ReferenceError trying to access row in OnRow of a Table
Goto Forum:
  


Current Time: Sat May 10 01:55:25 EDT 2025

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

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

Back to the top