AnsweredAssumed Answered

Error while connecting to Oracle using Groovy Script

Question asked by pratapp454763 on Jul 17, 2017
Latest reply on Jul 17, 2017 by jason_r_walsh667087

I am trying to connect to Oracle database using Groovy script (Since i have conditional mapping to be performed in map). I am using below code:

 

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

import java.sql.*;
import groovy.sql.Sql;
import java.sql.DriverManager;

def sql = Sql.newInstance('jdbc:oracle:thin:@(description=(CONNECT_TIMEOUT=10)(RETRY_COUNT=3)(address_list=(address=(protocol=tcp)(host=abc.com)(port=1500)))(connect_data=(SERVICE_NAME=ABC)))','UserName','Pwd','oracle.jdbc.driver.OracleDriver');

sql.eachRow('select sysdate from dual'){ row -> ChargeNumber};

sql.close();

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

I am getting below error:

Can someone help.

Outcomes