divman
11 years agoContributor
[Resolved] DB2 Connection Driver Error
Hi,
I know this could be a repeated question posted, but after researched from many threads i am still facing an connection error. I use SoapUI Pro 5.1.1. When i try to connect DB2 database with the below groovy script, i get an cound not find driver error. But when i use the JDBC step and configure with the UI steps, it says Connection successful (but still problem with building query).
Here is my code
when i run this script i get the error like "Tue Aug 26 08:58:45 EDT 2014:INFO:No suitable driver found for jdbc:db2://<Server>". Could anyone help me on this?
I know this could be a repeated question posted, but after researched from many threads i am still facing an connection error. I use SoapUI Pro 5.1.1. When i try to connect DB2 database with the below groovy script, i get an cound not find driver error. But when i use the JDBC step and configure with the UI steps, it says Connection successful (but still problem with building query).
Here is my code
import groovy.sql.Sql
try
{
sql = Sql.newInstance( "jdbc:db2://<Server>", "<user>", "<pass>", "com.ibm.db2.jcc.DB2Driver" );
} catch (Exception e)
{
log.info e.message
return
}
log.info "|ENT_CUST_ID| CRETN_TS| CRETN_USER_ID| UPDT_TS|";
sql.eachRow("SELECT * FROM cucrq01.ent_cnsmr WHERE (ENT_CUST_ID >= '101' and ENT_CUST_ID <= '200')")
{ row ->
log.info "|$row.ENT_CUST_ID| $row.CRETN_TS| $row.CRETN_USER_ID| $row.UPDT_TS";
}
sql.close()
when i run this script i get the error like "Tue Aug 26 08:58:45 EDT 2014:INFO:No suitable driver found for jdbc:db2://<Server>". Could anyone help me on this?