Forum Discussion

jalveblad's avatar
jalveblad
Occasional Contributor
12 years ago

JDBC request failing when selecting timestamp

Hi,

I have a JDBC request that is a simpe select:
SELECT * FROM SCHEMA.TABLE WHERE COLUMN = 'my string'

When this test test runs it only responds with "Error getting response; null" in SoapUI. In the cmd-window you get from starting with the bat-file I get this log.
14:16:47,686 INFO [AbstractHttpRequestDesktopPanel] Error getting response for
[Check Stuff in DB]; null
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException


If I change the * to a specific column name the test step works fine, except for the column that contains a timestamp.

If I run the query in a DB client such as DBVisualizer it can select the timestamp column.

So what can be causing this? A corrupt timestamp? Some hidden char in a timestamp somewhere?

Some info about my setup:
SoapUI 4.5.1 32-bit version running on Windows 7
Database, DB2 V9.5

5 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Maybe.

    If you select the timestamp column in your other tool, do you see any strange values?

    --
    Regards

    Erik
    SmartBear Sweden
  • jalveblad's avatar
    jalveblad
    Occasional Contributor
    Sadly no.
    If I remove the timestamp and replace it with (null) soapui can fetch the column.
    But when I type the timestamp manually it can't be fetched again.
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi!

    Hmm...

    The error you provided, is that the full contents of the error or do you get any additional error that might be leading us closer to the source of the error?

    --
    Regards

    Erik
    SmartBear Sweden
  • jalveblad's avatar
    jalveblad
    Occasional Contributor
    Hello,

    I scanned throught the cmd window when I executed the test case that includes this JDBC step. It seems like the db2 drivers I have doesn't support timestamp. Or do you interpret these logs differently?

    13:03:14,647 INFO [AbstractHttpRequestDesktopPanel] Error getting response for
    [Check Token in DB]; null
    13:03:14,647 ERROR [AbstractTestRunner] Exception during Test Execution
    java.lang.NoSuchMethodError: com.ibm.db2.jcc.a.b.a([BIILjava/lang/String;Ljava/s
    ql/Timestamp;Ljava/util/Calendar;)Ljava/sql/Timestamp;
    at com.ibm.db2.jcc.b.gc.r(gc.java:730)
    at com.ibm.db2.jcc.b.gc.F(gc.java:1319)
    at com.ibm.db2.jcc.b.vl.d(vl.java:1040)
    at com.ibm.db2.jcc.b.vl.getString(vl.java:1018)
    at com.eviware.soapui.support.xml.XmlUtils.addResultSetXmlPart(XmlUtils.
    java:1717)
    at com.eviware.soapui.support.xml.XmlUtils.createJdbcXmlResult(XmlUtils.
    java:1651)
    at com.eviware.soapui.impl.wsdl.panels.teststeps.JdbcResponse.<init>(Jdb
    cResponse.java:38)
    at com.eviware.soapui.impl.wsdl.panels.teststeps.JdbcSubmit.createRespon
    se(JdbcSubmit.java:334)
    at com.eviware.soapui.impl.wsdl.panels.teststeps.JdbcSubmit.runQuery(Jdb
    cSubmit.java:199)
    at com.eviware.soapui.impl.wsdl.panels.teststeps.JdbcSubmit.run(JdbcSubm
    it.java:161)
    at com.eviware.soapui.impl.wsdl.panels.teststeps.JdbcSubmit.<init>(JdbcS
    ubmit.java:75)
    at com.eviware.soapui.impl.wsdl.panels.teststeps.JdbcRequest.submit(Jdbc
    Request.java:135)
    at com.eviware.soapui.impl.wsdl.teststeps.JdbcRequestTestStep.run(JdbcRe
    questTestStep.java:205)
    at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestSt
    ep(AbstractTestCaseRunner.java:238)
    at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTe
    stStep(WsdlTestCaseRunner.java:48)
    at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalR
    un(AbstractTestCaseRunner.java:147)
    at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalR
    un(AbstractTestCaseRunner.java:42)
    at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractT
    estRunner.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$Worker.runTask(Unknown Source
    )
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    13:03:31,058 INFO [AbstractHttpRequestDesktopPanel] Error getting response for
    [Check Token in DB]; null
    13:03:48,485 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClient
    Connection] Connection closed

    Regards
    Jens
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi!

    Yes I think you're on to something. What version of the DB2 jdbc driver are you using?

    ---
    Regards
    Erik, SmarBear Sweden