I'm looking for a way to Call an existing database connxion in a tJava Component.
I have created a new BDD connexion in the JAVA Bloc , but this new connexion not permit me to use the data insert with the tMySqlConnexion Component because the first connexion do his commit at the end of the job.
I need to use in the JAVA bloc the same connexion using in the tMySqlConnexion.
Thank you for you help !
The tMysqlConnection component stores the connection in the job's globalMap. You can retrieve it from there and use it in your tJava component, like so:
java.sql.Connection c = (java.sql.Connection)globalMap.get("conn_tMysqlConnection_1");
This assumes that your tMysqlConnection has the unique name tMysqlConnection_1; change this to the actual name used in your job.
Related
I have created a desktop application in Golang which I call a function
handleSection(layout *widgets.QVBoxLayout)
which reads rows from a table in postgresql database, and for each row it creates a new
`widgets.NewQGroupBox2`
and then add require widget to this Group fox and finally add GroupBox as widget to main layout(passed as argument).
Now, when the database table is updated I want to update this GUI component as well, But I am not able to find how to do this.
Can some one tell me how to do that?
I have tried to return the address of *widgets.QGroupBox which contais all the Groupboxes at the end of for loop. and remove it using layout.removeWidget function, but it does not works.
I want to retrieve the value of a tJava component in a tMap component.
I made my program, and returns a row.ma_value
I create my schema as built-in.
I try to connect it to my tMap component but it doesn't give me any connection.
tJava is not to be used as a flow component. Use tJavaRow instead to pass rows to the next component. With tJavaRow you get 2 variables: input_row to access input flow columns, and output_row to access outgoing flow columns.
If you need tJavaRow to be the first component of the subjob, use tJavaFlex instead.
In AppMaker, one my datasources has a simple query script associated with, because I need a filter everytime the datasource is requested. I'm talking about a normal SQL based datasource (not calculated).
Is it normal than this query script is not used when the datasource is used in a Suggest box ? Because it breaks my app (the user is able via the suggest box to select items he's not even supposed to see).
Thanks for your help
The options for a suggest field text box can either be provided explicitly, by binding to the options property, or by specifying a database query on a model using a startsWith filter on a field. You can set the model and field for the latter option below.
So you can try to create calculated model with server script starts with
var name = query.filters.name.startsWith;
name is field of model
I need to set "PortAddress" and "WSDL Address" dinamically using the result of a query.
I've created the oracle Connector stage with my query. For example:
select col1,col2,col3,...,url
from myTable
How can I use "url" column value in the Web Service stage?
Thanks in advance.
This is a general problem not restricted to your web service transformer. You want to "transfer" data from a data stream to the Sequence level in order to feed it into the next job as a parameter.
Basically there are two main ways to do it:
Parallel Edition: In the first job where select the url from your database and write it to a value file of a parameter set. Use the parameter set in the second job with the new value file. Details see here
Server Edition: In a server job you select the data from your database in a transformer you can use a DataStage function (DSSetUserStatus) to set the so called UserStatus for this job. This can then be referenced in the next job of the Sequence.
I have a job that flows like this.
tAccessDatabse_1 ---> tFileOutputXML_1.
Now, my database has a schema, with usename and userid. My task to create/send data from the database to xml file, file name with username i.e, one file has to create for every user with his/her name.
I tried like creating a conetxt varible but how can i set username to that context variable from the database ??
Select distinct username from table.
Use tFlowToIterate to iterate on each of the usernames. (connect table component to this component using main link)
Use Iterate link to connect to tJava component.
Assign the username to context variable using tjava component. For eg. if output row from the table component is row1, then context.username=row1.username.
Connect tJava to a table component using 'OnComponentOk' to Select data from table based on the where condition: username='"+context variable+"'
Write data into file. Give filename as "<path>\"+context.username.
tYOURDBInput -> [row1] -> tFlowToItterate -> [itterate] -> tJava -> "globalMap.put("DESC", (String)row1.column);"
If you have just the one line then pick it up elsewhere via
(String) globalMap.get("DESC")
I used this setup to retrieve passwords to foreign systems stored in a table which are to be refreshed regurarily. This prevents code rebuilds everytime the password changes. Do protect your table naturally.