Hello,
I am trying to use Katalon Studio alongside the JDBC driver to hold a connection and perform a query on Microsoft SQL Server (ONLY MICROSOFT SQL NO OTHER PLEASE). This requires me to use the JDBC:SQLSERVER:// rather than the commonly used JDBC:MYSQL://
I have used all of the tutorials available online to get myself to a point where I can sort of connect using the following URL: jdbc:sqlserver://ServerName\Instance;database=dbName but it throws me the following error
`com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user ‘bradley’.
I am using Windows Authentication credentials so I’m not sure how to set up the state of my JDBC the correct way so I can perform queries… I was reading online that different URLS perform different ways. I know my DB is setup because I can connect through PHPStorm using the jdbc:sqlserver//… driver
TEST CASE SOURCE CODE: This just opens a browser and attempts the connection and query
WebUI.callTestCase(findTestCase(‘Admin/Open Browser/Open Admin Side Browser’), [:], FailureHandling.STOP_ON_FAILURE)
CustomKeywords.‘databaseTesting.connectAndSearch.connection’(‘jdbc:sqlserver://SERVER\INSTANCE;database=dbName’,
‘username’, ‘password’, ‘com.mysql.jdbc.Driver’)
CUSTOM KEYWORD CODE USED TO CONNECT
public class connectAndSearch {
@Keyword
public connection(String url, String user, String password, String driverClassName) {
def sqlConnection = Sql.newInstance(url, user, password, driverClassName);
sqlConnection.eachRow("Show tables") { row ->
println row[0]
}
}
}
There are too many ways of performing this action online and I cannot get all the puzzle pieces to work together if someone could at the very least help explain how I am to make the connection work.