robski
14 years agoNew Contributor
JDBC results vary depending on database.
Hello.
We are considering changing from Oracle to MySQL as our preferred database.
Our SoapUI tests do checks against databases as part of the tests to ensure values have been inserted/updated etc OK.
Problem is that when we run these SQL queries against Oracle using the oracle driver (oracle.jdbc.driver.OracleDriver) we get the results with the column/node names in the format:
However, when we run against a MySQL database using the MySQL J Connector (com.mysql.jdbc.Driver) driver we get the column name prefixed with the table name.
This is messing up all our assertions as the columns aren't found in the result set.
OK, we could change them manually, but there's an awful lot of them!
Anybody have any suggestions?
We are considering changing from Oracle to MySQL as our preferred database.
Our SoapUI tests do checks against databases as part of the tests to ensure values have been inserted/updated etc OK.
Problem is that when we run these SQL queries against Oracle using the oracle driver (oracle.jdbc.driver.OracleDriver) we get the results with the column/node names in the format:
<Row rowNumber="1">
<AUDITID>5</AUDITID>
<UPLOADED>2011-07-11 09:26:29.0</UPLOADED>
<CLIENTID>ADC00001</CLIENTID>
<MACHINEID>42</MACHINEID>
<COMPONENTNAME>soapUI</COMPONENTNAME>
<OPERATION>logMessageTest1</OPERATION>
<MESSAGETEXT>Hello</MESSAGETEXT>
<ADDITIONALDATA>Additional Data</ADDITIONALDATA>
<STATUSCODE>0</STATUSCODE>
</Row>
However, when we run against a MySQL database using the MySQL J Connector (com.mysql.jdbc.Driver) driver we get the column name prefixed with the table name.
<Row rowNumber="1">
<AUDIT.AUDITID>1</AUDIT.AUDITID>
<AUDIT.UPLOADED>2011-07-28 10:19:57.0</AUDIT.UPLOADED>
<AUDIT.CLIENTID>CONFTEST</AUDIT.CLIENTID>
<AUDIT.MACHINEID>101</AUDIT.MACHINEID>
<AUDIT.COMPONENTNAME>AUDIT_TEST1</AUDIT.COMPONENTNAME>
<AUDIT.OPERATION>TESTING</AUDIT.OPERATION>
<AUDIT.MESSAGETEXT>Message text data to be inserted into database</AUDIT.MESSAGETEXT>
<AUDIT.ADDITIONALDATA>Additional data to be inserted into the database</AUDIT.ADDITIONALDATA>
<AUDIT.STATUSCODE>1001</AUDIT.STATUSCODE>
</Row>
This is messing up all our assertions as the columns aren't found in the result set.
OK, we could change them manually, but there's an awful lot of them!
Anybody have any suggestions?