Setting DataBase Properties

One Star

Setting DataBase Properties

Hi All,
While creating a new DB connection we will give the details like DB driver, Data source name login details etc,.
Is there any facility, that allows to read the above(database) details from a File? That is, I will give the same details in a file. Now my job needs to load the DB property details from that file.
Is that possible? If it is, plz tell me how to do that.
Regards,
Venky
Employee

Re: Setting DataBase Properties

Hi venky,
A new component provides this facility : tContextLoad. It reads an input component with 2 columns ( name, value) and loads the current context with these values.
Best Regards
One Star

Re: Setting DataBase Properties

Hi rbillerey,
Can i find any documentation on this component.?
The schema of this component contans only two fileds, Key and value and those are noneditable, but i need fields with details like DB driver name, DB name, login details.. etc.
I would like to read the DB properties details from this file instead of entering manually, which we do while creating a new DB connection.
plz tell me how to use this component for this purpose.
Thanks in advance,
Venky
Employee

Re: Setting DataBase Properties

Here's the way to do it :
1/ Create the context variables you need : host, port, database, user, password ( in the Properties/Context panel ; to display this panel, click the background of the job design panel )
2/ Set the property fields of your tDBInput component with the context variables you've just created ( use CTRL - SPACE to display the variable list ).
3/ Create a csv file like this :
host;your_host
port;your_port
database;your_db
user;your_user
password;your_password

4/ Use a tFileInputDelimted with a 2 column schema ( key, value ) and connect it to a tContextLoad
5/ Connect the tContextLoad component to your tDBInput with a trigger/Run if Ok
6/ Run your job ( F6 )
Hope it helps
One Star

Re: Setting DataBase Properties

Hi rbillerey,
Thanks for your timely reply. But i couldn't make this. My job is unable to read the DBProperty details from context variables.
I am using java version.
i have followed the steps as you said,
i have created context varibles and selected the context type from repository.
I have connected tFileinputdelimited(CSV which u said to create), with schema(key,value), with tContextLoad component.
And tContextLoad and tSybaseInput with 'run if ok' connection.
Before connecting, the schema of the tContextLoad is, Key, value. But after connecting with the fileinput, the schema is changed to,
Key,value,key,value.
Fileinput schema: tContextLoad schema: (NON EDITABLE)
key key
value value
key
value
I think, this non similarity in schema is giving me the error(unable to read the DBProperty details from context variables).
plz correct if i did any mistake and tell me how to solve this.
Thanks in advance,
Venky
Employee

Re: Setting DataBase Properties

You're right, it's a bug. Just delete the 2 additional columns that are not read-only and it should work.
One Star

Re: Setting DataBase Properties

The schema of tLoadcontext is non editable. All the 4 columns(key,value,key,value) are read-only. There are no columns which are not read-only. And the right arrow(-->, for sync. the schema) is also not active.
So, how can i change this schema relevant to tFileinput.
Employee

Re: Setting DataBase Properties

Hi,
This issue has been fixed and will be available in next release of TOS.
One Star

Re: Setting DataBase Properties

Hi,
This issue has been fixed and will be available in next release of TOS.

It still bugs in TOS 2.1.0 with Java !?!
There is way to skip it : delete the input rows in the tLoadContext then create them again in your tFileInput
One Star

Re: Setting DataBase Properties

Smiley Surprised !!
I correct the error using the method above, I run the job and it works.
I save the job, I close it, I open it again and the error is still here !
What appends ?
Do you manage to use tContextLoad ?
TOS 2.1.0 r4515
regards,
have a good week end
Ben
Employee

Re: Setting DataBase Properties

bedurand, I advise you to create a new issue in the bugtracker to have this bug fixed :-)
One Star

Re: Setting DataBase Properties

1689
One Star

Re: Setting DataBase Properties

(0003153)
mhirt
2007-07-31 00:14
Your column have to be named "key" and "value" in lowercase.

Thank you mhirt !
Nullable must be set at yes and length at 255. This must be exactly the same schema
(When issues are closed, can we add notes ?)
One Star

Re: Setting DataBase Properties

hi,
i tried to use this tContextLoad and i confirm... it works.
Thank you for this post, with this component it's quite easy to modify parameters