One Star

Not able to connect to a database using context variables talend open studio for Big Data 6.3.1

hello there

I'm using talend open studio for Big Data and trying to connect to a DB using context variables. It fails with an exception. If I connect to the DB using the values instead of context variables then everything is fine. 

 

here is a screenshot of the OracleOutput component setup with context variablesDB access component setupDB access component setup

if I click on the ... button (which is near the table field) - I will get the following error. It says that Network adapter could not create a connection. If I put values to all the fields but user name - then try to connect it will complain about wrong user name. Apparently the values of the context variables are not placed correctly

 

4.png

my DB connection for Oracle with the context variables. If check the connection then I will connect

DB connection in metadataDB connection in metadata

here is my context

contextcontext

 

I checked the generated sources and found the following

1. all my context variables were marked red (I underlined them)

2. the ContextProperties class didn't have those variables (such as  context.Ora_25_49_LoginSmiley Wink

 

I tried the same set up in Open Studio for ESB and everything was fine there. 

 

Please help me to resove the issue 

----------------------------------

url_tOracleOutput_1 = "jdbcSmiley Surprisedracle:thin:@(description=(address=(protocol=tcp)(host="
+ context.Ora_25_49_Server
+ ")(port="
+ context.Ora_25_49_Port
+ "))(connect_data=(service_name="
+ context.Ora_25_49_ServiceName + ")))";
String dbUser_tOracleOutput_1 = context.Ora_25_49_Login;

final String decryptedPassword_tOracleOutput_1 = context.Ora_25_49_Password;

String dbPwd_tOracleOutput_1 = decryptedPassword_tOracleOutput_1;
dbschema_tOracleOutput_1 = context.Ora_25_49_Schema;

--------------------------------

public class ContextProperties extends java.util.Properties {

private static final long serialVersionUID = 1L;

public ContextProperties(java.util.Properties properties) {
super(properties);
}

public ContextProperties() {
super();
}

public void synchronizeContext() {

}

}

private ContextProperties context = new ContextProperties();

public ContextProperties getContext() {
return this.context;
}

  • Big Data
2 REPLIES
Ten Stars

Re: Not able to connect to a database using context variables talend open studio for Big Data 6.3.1

Shouldn't the values for your String variables be wrapped in quotes?

Ten Stars

Re: Not able to connect to a database using context variables talend open studio for Big Data 6.3.1

Are the context variables actually imported into your job? Check the "Contexts" tab and see if they exist within the job. It sounds like they may not. Can you give us a screenshot of your "Contexts" tab?

Rilhia Solutions