R Fields wrote:
> Hello,
>
> We are getting mixed results for this bug fix (we
> are using
> mysql-connector-java-3.1-nightly-20050316-bin.jar)
> .
>
> In some snippets of code, it now appears to be
> working, and we are getting a String back. In
> others, we continue to get the blob.
>
> The following snippet of code (that we use to map
> the results into a Vector of Hashtables) continues
> to have the problem:
>
> public static Vector
> createResultsVector(ResultSet rs) throws
> DBException {
> try {
> Vector resultVector = new Vector();
> ResultSetMetaData meta =
> rs.getMetaData();
> while (rs.next()) {
> Hashtable currentRow = new
> Hashtable();
> for (int i = 1; i <=
> meta.getColumnCount(); i++) {
> Object data =
> rs.getObject(i);
> // let's print this out to see
> what we're getting here
>
> System.out.println(meta.getColumnName(i) + "-" +
> data.getClass().getName());
> if (data != null) {
>
> currentRow.put(meta.getColumnName(i), data);
> }
> }
>
> resultVector.addElement(currentRow);
> }
> return resultVector;
>
>
> }
> catch (SQLException e) {
> cat.error("DB.createResultsVector
> failed: " + e.getMessage());
> }
> }
>
>
> Thank you,
> -Richard
Richard, without seeing the query and the DDL of the table(s) involved, this code isn't much help.
This is really unfortunately a server bug that the driver has to work-around, so not all cases are currently caught.
-Mark
Mark Matthews
Consulting Member Technical Staff - MySQL Enterprise Tools
Oracle
http://www.mysql.com/products/enterprise/monitor.html