JDBC enconding MySQL text values?

Setup:

MySQL 3.23.41/Jakarta Tomcat 3.2.3/Apache 1.3.20/ JDK1.3.1/Redhat Linux 7.1/ and Macromedia Ultradev for JSP development.

JDBC driver: mm.MYSQL.jdbc.Driver version 1.2c also tried mm.mysql.2.0.1.bin.jar.

Problem: JSP pages generated by Ultradev, to add, delete, and update records to a MySQL database work great, EXCEPT: The JSP page that displays values from a "text" data type field is encoding the values. For example the JSP page displays [B@738d08 for any "text" type value. All other datatype values work fine though. Also, The text values look fine when I view them through my sql client. Several forums are saying that my JDBC driver is causing that.

My classpath to the jdbc driver is set right.

Any ideas? What JDBC version should I be using for this setup? TIA

Carlos

[838 byte] By [calberto00] at [2007-9-26 5:41:49]
# 1
"[B@..." is what you get when you do toString() on an object of type byte[], I think. So my guess is that what the driver returns from a "text" field is not a String but a byte array. You can convert this to a String using the String constructor that takes byte[] as its parameter.
DrClap at 2007-7-1 13:58:27 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2

Ultradev uses getObject() to retrieve values from the result set. For some reason, this causes problems with the mySQL driver (specifically, I've noticed, with results from joins). To work around this, simply change the getObject() calls to getString() calls and everything will work fine.

Hope that helps...

-Rob

rhewlett at 2007-7-1 13:58:27 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...