Forum Discussion

Jim_Cusack's avatar
Jim_Cusack
Contributor
17 years ago

DataSource JDBC query

I was able to create a DataSource Query using property expansion and tested it to completion, but when I try to run it in the full test case it fails to run with a Network Adpater Error:

TestCase failed [java.lang.Exception: Failed to prepare testStep [DataSource]; java.sql.SQLException: Io exception: The Network Adapter could not establish the connection:java.lang.Exception: Failed to prepare testStep [DataSource]; java.sql.SQLException: Io exception: The Network Adapter could not establish the connection], time taken = 0

How can it retrieve rows when I test the step seperately, but not as part of the Test Case?
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi Jim,

    hmm.. are you maybe using some property-expansion that doesn't work correctly when running the TestCase/TestSuite? Can you show a screenshot of your DataSource config?

    regards!

    /Ole
    eviware.com
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi,

    hmm.. could you try hard-coding the connection string to see if the property-expansion is failing when running the TestCase?

    regards,

    /Ole
    eviware.com
  • Ok - I ran it hard coded and it runs in the test case, but I still need a variable in the SQL query that is not being picked up!
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi,

    ok.. hmm.. are these global properties that you are expanding?

    regards,

    /Ole
    eviware.com
  • parvezaham's avatar
    parvezaham
    New Contributor
    Even i am facing the same problem.
    When i use a data source with 100 requests per second. I get the following error "(java.lang.Exception: Failed to prepare testStep [DataSource]; java.sql.SQLException: Io exception: The Network Adapter could not establish the connection)". and i see a lot of error's with this exception in the log.

    Please let me know if there is a solution for this problem.

    Thank You,
    Parvez.