One Star

How to call SP in amazon aurora database in Talend

Hi ,
Is there any sp like tmysqlSp for amazon aurora???
if not then what is the alternative ?
note : I need to use an existing connection ( that is tamazonAuroraConnection) for calling SP so that i can rollback.

3 REPLIES
Seventeen Stars

Re: How to call SP in amazon aurora database in Talend

Currently you can only do this task with pure Java code in a tJava component.
Here an idea (not complete or tested but it gives you an idea).
try {
  java.sql.Connection conn = (java.sql.Connection) globalMap.get("conn_tAmazonAuroraConnection_1");
  java.sql.Statement stat = conn.createStatement();
  String sql = "select my_proc()";
  stat.execute(sql);
  stat.close();
} catch (java.sql.SQLException sqle) {
  globalMap.put("ERROR_MESSAGE", sqle.getMessage());
  throw sqle;
}

You have to change the unique id of the connection in the first line and the sql code of the procedure call.
One Star

Re: How to call SP in amazon aurora database in Talend

Thank you so much jlolling.  Yes it gave me an idea.
One Star

Re: How to call SP in amazon aurora database in Talend

Hello,

Could you confirm whether the below approach of writing custom java code to invoke SP from Amazon Aurora database worked? If yes, Could you share the custom Java code that is written to solve this issue ? or did you try any other alternatives to invoke SP from Amazon Aurora rds.

 

Thanks much!!

Karthik