Discussions

EJB design: Does resultset.getInt result in a network trip

  1. Hi,

    Is there a network trip involved when I do a resultset.getInt() or resultset.getString() in the DAO layer ?

    Is this different for different drivers ? If so, how does it work for DB2 ?
  2. Hi,Is there a network trip involved when I do a resultset.getInt() or resultset.getString() in the DAO layer ?Is this different for different drivers ? If so, how does it work for DB2 ?

    I would imagine that it is up to JDBC driver implementation. Some might have all the data fetched, some not.

    Cannot say anything about DB2 - don't use it.
  3. It does not result in network trip again. Its stupidity on the part of the JDBC drivers to implement such kind of mechanism. As far I know, the object is at the client side which has the records from the database. You iterate through and get the data. So resultset.getInt will fetch you the data from the object rather than again making the round trip to the DB server.