Bug #1229 All fields are getting java.sql.VARCHAR type
Submitted: 9 Sep 2003 1:29 Modified: 9 Sep 2003 5:39
Reporter: Siva Dirisala Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S2 (Serious)
Version:3.1.0-alpha OS:Linux (Linux 4.22)
Assigned to: CPU Architecture:Any

[9 Sep 2003 1:29] Siva Dirisala
Description:
The getObject(index) is returning all objects as String even though they should
be different. My code works fine when I type cast the getObject(index) to an 
Integer using 3.0.8-stable version. However, with 3.1.0-alpha, the type casting
is failing.

How to repeat:
Select any non-string field and use the getObject(index) and see that the returned
java object is a String object. I put some debug code in the ResultSet.java and
found that the fields[columnIndex-1].getSQLType() are all returning 12 which is
java.sql.Types.VARCHAR.
[9 Sep 2003 1:31] Siva Dirisala
I am using 4.1.0-alpha-standard as the database. My intention to try 3.1.0 is
to make use of the server side prepare statements. However, that is not working
for me (I need to findout why) as the created object is still a com.mysql.jdbc.PreparedStatement and not a ServerPreparedStatement. So, looks like
a regression issue as it breaks 3.0.8 code.
[9 Sep 2003 5:39] Mark Matthews
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

This has been fixed for quite some time in the source repository. You also need to use a BK version of MySQL-4.1 along with a nightly snapshot of Connector/J 3.1 (from http://mmmysql.sourceforge.net/snapshots/dev), as the network protocol between the two has changed.