I have been using groovy script to setup the test DB from a set of test data from another database (we have lots of test data).
Is there a way in Groovy (I admit I'm not an expert on Groovy) to insert the data from one DB to another DB without having to explicitly set the column names? It's getting a little labour intensive and it would be great help to have a script to iterate through the table and insert those rows in the test DB without having to manually create the SQL with the column names.
Essentially I want to retrieve the column names from the result set.
I have managed to narrow it down to that this driver may not support username and passord in the URL. I have used another driver (db2jcc) which supports the user and password in the string and now I'm getting:
Mon Jun 16 06:30:19 BST 2008:ERROR:An error occured [[ibm][db2][jcc][10103][10941] Method executeQuery cannot be used for update.], see error log for details
This is the SQL I'm using:
"SELECT * FROM YESNONA"
I'm really frustrated with this. I would want to purchase soapUI pro and get started with my testing, but I really can't do any testing with a DB connection.
I tried to run the following groovy Unit Test script in soapUI:
import groovy.util.GroovyTestCase
class MyTest extends GroovyTestCase { void testSomething() { assert 1 == 1 assert 2 + 2 == 4 : "We're in trouble, arithmetic is broken" } }
And I got the following casting error: Fri Jun 13 16:26:57 BST 2008:ERROR:groovy.lang.GroovyRuntimeException: Failed to create Script instance for class: class MyTest. Reason: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'org.apache.log4j.Logger@1560b81' with class 'org.apache.log4j.Logger' to class 'java.util.logging.Logger'
Is this a bug or did I do something wrong with the script?
1) Can you see in the soapui log that the driver jar is being loaded at startup? Yes Fri Jun 13 11:03:28 BST 2008:INFO:Added [file:/C:/Program%20Files/eviware/soapUI-Pro-2.0.2/bin/ext/db2java-8.jar] to classpath
2) What is the exact error message you are getting? (details in the error-log?) Fri Jun 13 11:03:45 BST 2008:ERROR:java.sql.SQLException: No suitable driver found for jdbc:db2://xxxxxx.uk.gl3:000000/XXXXXX
I searched through the forums and people have posted similar issues but no resolution was posted to those. Hence I'm posting again.
I'm trying to connect to DB2 via JDBC from soapUI (tried both Datasource and Groovy script) and they both complain about not finding a suitable driver when I have copied the jar file in soapui/bin/ext (and jre/lib/ext).
This is the driver and string I'm using: COM.ibm.db2.jdbc.app.DB2Driver jdbc:db2://xxxxxxx.uk.gl3:XXXXX/XXXXXX