How to connect to a Database (via Scripting)

I am trying to customise the Auto Generated Groovy script for connecting in to a DataBase ,
Can you please let me know the procedures involved to customise and run the
Auto Generated (Recorded) Groovy script for DB connection , Result validation etc.

Please check the related code in Groovy.

@VParamasivam - please see these topics: