Forum Discussion

thatsthat's avatar
thatsthat
Contributor
2 years ago

Executing JDBC on its own runs the query but as part of a test case the same JDBC step fails to run.

Quite puzzled by this.

When I kick off this Test case .. the JDBC step ('JDBC Status Check') fails and I see the below in the error logs.

But if I now go directly to the step and run it on its own .. I get the desired Response.

What would you look for to troubleshoot where a JDBC Test step runs fine in isolation but fails as part of a test case?

 

Fri Apr 21 13:51:59 AEST 2023: ERROR: An error occurred [Incorrect syntax near the keyword 'and'. ], see error log for details

  • Fri Apr 21 14:01:08 AEST 2023: ERROR: java.sql.SQLException: Incorrect syntax near the keyword 'and'.
  • java.sql.SQLException: Incorrect syntax near the keyword 'and'.
  • at com.sybase.jdbc4.jdbc.SybConnection.getAllExceptions(Unknown Source)
  • at com.sybase.jdbc4.jdbc.SybStatement.handleSQLE(Unknown Source)
  • at com.sybase.jdbc4.jdbc.SybStatement.nextResult(Unknown Source)
  • at com.sybase.jdbc4.jdbc.SybStatement.nextResult(Unknown Source)
  • at com.sybase.jdbc4.jdbc.SybStatement.executeLoop(Unknown Source)
  • at com.sybase.jdbc4.jdbc.SybStatement.execute(Unknown Source)
  • at com.sybase.jdbc4.jdbc.SybPreparedStatement.execute(Unknown Source)
  • at com.eviware.soapui.impl.wsdl.panels.teststeps.JdbcSubmit.load(JdbcSubmit.java:222)
  • at com.eviware.soapui.impl.wsdl.panels.teststeps.JdbcSubmit.runQuery(JdbcSubmit.java:185)
  • at com.eviware.soapui.impl.wsdl.panels.teststeps.JdbcSubmit.run(JdbcSubmit.java:157)
  • at com.eviware.soapui.impl.wsdl.panels.teststeps.JdbcSubmit.(JdbcSubmit.java:89)
  • at com.eviware.soapui.impl.wsdl.panels.teststeps.ProJdbcSubmit.(ProJdbcSubmit.java:12)
  • at com.eviware.soapui.impl.wsdl.panels.teststeps.ProJdbcRequest.submit(ProJdbcRequest.java:15)
  • at com.eviware.soapui.impl.wsdl.teststeps.JdbcRequestTestStep.run(JdbcRequestTestStep.java:238)
  • at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:302)
  • at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:53)
  • at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:192)
  • at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:1)
  • at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:130)
  • at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
  • at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
  • at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
  • at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
  • at java.base/java.lang.Thread.run(Thread.java:833)
  • When it executes (and fails), grab the JDBC Status Check SQL from the Raw tab.
    Try to run that separately, check for syntax errors.

    Perhaps you are using property expansion in the sql that is not being set as expected which is breaking the SQL statement - Incorrect syntax near the keyword 'and'

2 Replies

  • When it executes (and fails), grab the JDBC Status Check SQL from the Raw tab.
    Try to run that separately, check for syntax errors.

    Perhaps you are using property expansion in the sql that is not being set as expected which is breaking the SQL statement - Incorrect syntax near the keyword 'and'

    • thatsthat's avatar
      thatsthat
      Contributor

      Ahh spot on mate .. found the error of my ways by looking at the RAW value.

      Cheers