OCCI versus JDBC (Incredible Results!!!) : I'm very surprise with a performance test comparing OCCI (Oracle C++ Call Interface) and the old JDBC.

Here is the code:
<pre><code>

    #include &lt;iostream&gt;
    #include &lt;cstdlib&gt;
    #include &lt;occi.h&gt;
    
    using namespace oracle::occi;
    using namespace std;
    
    const string username   = "system";
    const string password   = "******";
    const string url        = "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=XE)))";
    const string sql        = "select * from CREDITO.movtos_cuentas";
    
    int main(int argc, char** argv) {
    
        cout << "Oracle Connectivity" << endl;
    
        Environment *env = Environment::createEnvironment(Environment::DEFAULT);
        Connection *conn = env->createConnection(username, password, url);
        Statement *stm = conn->createStatement(sql);
        ResultSet *rs = stm->executeQuery();
        
        unsigned long count = 0;
        
        while (rs->next()) {
            count++;
        }
        
        stm->closeResultSet(rs);
        conn->terminateStatement(stm);
        env->terminateConnection(conn);
        Environment::terminateEnvironment(env);
        
        cout &lt;&lt; "Registros na CREDITO.MOVTOS_CUENTAS: " &lt;&lt; count &lt;&lt; endl;
    
        return 0;
    }

</code></pre>

And here is Java code:

<pre><code>

    package oraconnect.jdbc;
    
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    
    public class OraconnectJdbc {
    
        public static void main(String[] args) {
            Connection conn = null;
            Statement stm = null;
            ResultSet rs = null;
            
            try {
                Class.forName("oracle.jdbc.driver.OracleDriver");
                conn = DriverManager.getConnection(
                        "jdbc:oracle:thin:@127.0.0.1:1521:xe", "system", "******");
                stm = conn.createStatement();
                rs = stm.executeQuery("select * from CREDITO.movtos_cuentas");
                long count = 0;
                while (rs.next()) {
                    count++;
                }
                
                System.out.printf("Registros na CREDITO.MOVTOS_CUENTAS: %d\n", count);
            } catch (Exception e) {
                e.printStackTrace();
            } finally {
                if (rs != null) {
                    try {
                        rs.close();
                    } catch (SQLException e) {
                        //Ignore
                    }
                }
                if (stm != null) {
                    try {
                        stm.close();
                    } catch (SQLException e) {
                        //Ignore
                    }
                }
                if (conn != null) {
                    try {
                        conn.close();
                    } catch (SQLException e) {
                        //Ignore
                    }
                }
            }
        }
    }

</code></pre>

I suspect that have made a mistake or use bad practices with C++ version.
Any body can help me to understand this result!?!?!?
