Forum Discussion

e2x_Limited_Sup's avatar
e2x_Limited_Sup
New Contributor
13 years ago

Cannot get JDBC Datasink working with Oracle DB

Hello

I am trying to write data to the same Oracle DB that I am reading from in my datasource step. In this instance I am trying to write a generated email address to a column that already exists. I am storing the generated email each time as a custom property at the test case level.

Each data loop creates a new unique email that I wish to record against each data row.

Here is my SQL:

Insert into data_table_name ('EMAIL_ACTUAL') values ('?')


I also have a property on the datasink step called email_actual
The database connection connects fine.

Iam using SoapUI Pro 4.6.0

Here are the logs from the error tab - I have nothing on the Data Log tab - I hear there are more logs available I do not know how to trun them on in SoapUI Pro .

Mon Sep 30 19:22:58 BST 2013:ERROR:java.sql.SQLException: Invalid column index
java.sql.SQLException: Invalid column index
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:113)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:147)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:209)
at oracle.jdbc.driver.OraclePreparedStatement.setStringInternal(OraclePreparedStatement.java:5405)
at oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement.java:5397)
at com.eviware.soapui.impl.wsdl.teststeps.datasink.JdbcDataSink.save(SourceFile:369)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlDataSinkTestStep.write(SourceFile:313)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlDataSinkTestStep.run(SourceFile:131)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:239)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:48)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:148)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:43)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:135)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

1 Reply

  • Hi!

    So here's how I interpret what you're trying to do. Please correct me if I'm wrong.

    You're reading from a database (using a datasource test step), and at some point during your test case, you're generating an email address (or does it come from somewhere else?). This email address is stored as a test case-level property. Then, finally, you want to insert this new email address into the same database you read from to begin with. Is that correct?

    You can do this by, in your DataSink test step, running the following query:
    INSERT INTO data_table_name ('EMAIL_ACTUAL') VALUES (${#TestCase#name_of_the_email_property})

    This will use the property you have stored on the TestCase and use it in the query.

    If I've misunderstood anything, or if this doesn't solve your issue, please let me know and I'll happily assist further.

    Regards,
    Arian
    SmartBear Sweden