Forum Discussion

sakthivel's avatar
sakthivel
Contributor
8 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 from Database. 

 

Thanks

Sakthi

 

  • //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"

    log.info sql_query

  • bpbalu's avatar
    bpbalu
    Occasional Visitor

    //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"

    log.info sql_query