Author: shawkins
Date: 2011-12-14 13:56:43 -0500 (Wed, 14 Dec 2011)
New Revision: 3739
Modified:
branches/7.6.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQL5ExecutionFactory.java
Log:
TEIID-1871 fix for calling getObject returing bytes, rather than a string
Modified:
branches/7.6.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQL5ExecutionFactory.java
===================================================================
---
branches/7.6.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQL5ExecutionFactory.java 2011-12-14
18:54:24 UTC (rev 3738)
+++
branches/7.6.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQL5ExecutionFactory.java 2011-12-14
18:56:43 UTC (rev 3739)
@@ -23,6 +23,7 @@
package org.teiid.translator.jdbc.mysql;
import java.sql.Blob;
+import java.sql.CallableStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
@@ -90,4 +91,14 @@
return result;
}
+ @Override
+ public Object retrieveValue(CallableStatement results, int parameterIndex,
+ Class<?> expectedType) throws SQLException {
+ Object result = super.retrieveValue(results, parameterIndex, expectedType);
+ if (expectedType == TypeFacility.RUNTIME_TYPES.STRING && result instanceof
Blob) {
+ return results.getString(parameterIndex);
+ }
+ return result;
+ }
+
}
Show replies by date