Datasheet with SQL SERVER as a database in JDBC step getting error with select: Error: database query problem
search cancel

Datasheet with SQL SERVER as a database in JDBC step getting error with select: Error: database query problem

book

Article ID: 8962

calendar_today

Updated On:

Products

CA Application Test CA Continuous Application Insight (PathFinder) Service Virtualization

Issue/Introduction

Trying to run a test in DevTest by taking data from SQL SERVER Database.  Datasheet with SQL SERVER is the database.

In the JDBC input step when giving the query for the database table, it everytime throws an error- database Query problem..

The data can be seen correctly in SQL Server studio but it does not run in DevTest

Able to test the connection from test step and also from datasheet.

Environment

All supported DevTest releases and platforms.

Cause

Connection string not in the expected format.

Resolution

This issue we notice if a connection string has not set in expected format

like:   connection string in test step or datasheet has given as below

jdbc:sqlserver://[SERVER_NAME]:{PORT}

   where as the SQL SERVER has multiple databases and the given query table exists on a database say DB1. Since the Devtest can not find on which database, this table exists. Due to that, we get an error.

To fix this error, please add databaseName parameter to connection string like below

jdbc:sqlserver://[SERVER_NAME]:{PORT};databaseName=DB1

and execute the query.