02-02-2018 02:20:15 PM - [ERROR] - com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
02-02-2018 02:20:15 PM - [END] - End action : sqlConnection.DemoMySql.connectDB
Cannot cast object 'ConnectionID:1 ClientConnectionId: 15eb12d8-0684-4dac-9392-c6ef22e94aeb' with class 'com.microsoft.sqlserver.jdbc.SQLServerConnection' to class 'com.mysql.jdbc.Connection'
I just had the same problem. In my opinion, kishor’s changes to the Keywords file should not work at all. Because like me, he didn’t use a mysql server but a MS SQL server. Therefore the line …
In addition, it seems helpful to me to point out the different structure of the connection string for the SQL Server, since the source linked in the above-mentioned Katalon article does not really continue at this point. But the project settings dialog for the database connection in Katalon Studio does this already:
Forget completely about this above mentioned, much too cumbersome Keywords file! All you need is the groovy.sql.sql class and only one Keyword routine to build the desired SQL instance, like this one:
This is probably the grooviest way to really use the advantages of Groovy. And it is completely sufficient not to have to deal with the peculiarities of ResultSet and the cumbersome necessity of pushing its pointer forward within the TestCase. Because this groovy.sql.Sql class brings its own groovish methods to process the result sets as maps or lists: