Forum Discussion

sakthivel's avatar
7 years ago

How to create SOAP JDBC Request using Groovy Script

Hi,        How to create SOAP JDBC request using Groovy Script. Could any one provide some examples. I am looking for Groovy script to create SOAP JDBC request by automatically and read some rows fr...
  • bpbalu's avatar
    7 years ago

    //Build connection string first 

    def db_conn_Str  = "" + DBSrv_name +";" + "databaseName="+ DB_val + ";" + "user=" + user_val +";" + "password=" +                                               pass_val + ""

    //Establish JDBC Connection to the DB
    def conObj = Sql.newInstance(db_conn_Str  );
    def table_Name = context.expand( '${#Table_Name}' )


    //Run a Query
    String sql_query = "SELECT count(*) as row_count FROM $table_Name" sql_query