JdbcControl & Foxpro - Data not returned by PreparedStatement
-------------------------------------------------------------

                 Key: BEEHIVE-1203
                 URL: https://issues.apache.org/jira/browse/BEEHIVE-1203
             Project: Beehive
          Issue Type: Bug
          Components: System Controls
         Environment: Windows XP
Beehive 1.0.2
HXTT Fox pro jdbc driver (3.0)
Tomcat 5.5
Apache commons connection pool (org.apache.commons.dbcp.BasicDataSourceFactory)
            Reporter: Steven Dalton


When attempting to retrieve data from the foxpro database, the ResultSet (or 
Object) from the PreparedStatement was null.

By recreating as many conditions for the PreparedStatement as provided by the 
JdbcControl, I discovered that the getting of the update count before getting 
the ResultSet was the cause.

I moved the ps.getUpdateCount() method until after the ps.getResultSet() method 
call and the data was returned.

Unfortunately I can't determine the reason for the problem (suspect a problem 
with the driver), but the problem is fixed using the change below.

SQLServer database actions continue to work as expected with this change.  Not 
sure about other databases.

Changed from
            //
            // process returned data
            //
            ResultSet rs = null;
            int updateCount = ps.getUpdateCount();

            if (hasResults) {
                rs = ps.getResultSet();
            }

to
            //
            // process returned data
            //

            ResultSet rs = null;
            int updateCount = -1;

            if (hasResults) {
                rs = ps.getResultSet();
            }

            updateCount = ps.getUpdateCount();

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to