List:MySQL and Java« Previous MessageNext Message »
From:Mark Matthews Date:July 7 1999 1:06am
Subject:Re: MySQL "Text" fields and mm.mysql driver
View as plain text  
On Tue, 6 Jul 1999, Cris Perdue wrote:

> Hi,
> 
> The MySQL database for our site uses the "text" datatype for certain
> relatively long textual data. This works fine for most purposes, but
> some of our code uses metadata, or simply the "getObject" method, to
> fetch data from result sets, and this does not work as desired using the
> 
> MM driver.
> 
> With the MM driver, ResultSet.getObject throws an exception ("unknown
> SQL type"), and the ResultSetMetaData indicates that the SQL type is
> "LONGVARBINARY", or blob.
> 
> I looked through the ListQuest mail archive, and did see a message from
> Monty last year saying that there is a flag available to distinguish
> "blob" data from "text" data.  In this case I presume the driver would
> be able to distinguish between "blob" and "text", and getObject could
> return a String for a "text" field.

I will look into it. Of course this will only work when connected to 
versions of MySQL that support this.

As a work-around, I think I will have ResultSet.getObject() return a 
String if it can't figure out what to do. This might be more sensible 
than throwing an exception, as any of the MySQL types can come back as a 
String.

	-Mark (author of MM.MySQL)
Thread
MySQL "Text" fields and mm.mysql driverCris Perdue7 Jul
  • Re: MySQL "Text" fields and mm.mysql driverMark Matthews7 Jul
    • JDBC and ExceptionRoberto Moreno8 Jul
Re: MySQL "Text" fields and mm.mysql driverCris Perdue7 Jul