Hello,
yes, you will need an open connection to navigate through the resultset.
Because of performance reasons the driver don't get all of the rows of the
resultset at once. There is a caching algorithm inside the JDBC-driver that
gets the other rows on demand. For this purpose an open connection is
needed.  

Regards,
Marco
----------------------------------------------
Marco PASKAMP
SAP DB, SAP Labs Berlin

> -----Original Message-----
> From: Jens Panse [mailto:[EMAIL PROTECTED]]
> Sent: Freitag, 5. April 2002 11:34
> To: SAP DB newsgroup
> Subject: jdbc ObjectIsClosedException
> 
> 
> Hallo,
> 
> Normally this code sequence is working fine.
> This works with other databases / jdbc drivers like 
> Cach�Jdbc, instantdb
> jdbc ... that's why we
> haven't got any idea...
> 
>  System.out.println---------->Connection.isClosed() = true
> 
>  ResultSetMetaData tRsmd = tResultSet.getMetaData();
>  int tCols = rsmd.getColumnCount();
> 
> The ResultSet object still exists here:
> 
>  System.out.println---------->ResultsetMetaData
> com.sap.dbtech.jdbc.ResultSetMetaDataSapDB@3f7281
>  System.out.println---------->ResultsetMetaData.getColumnCount() = 25
>  System.out.println---------->Resultset
> com.sap.dbtech.jdbc.ResultSetSapDB@76ab2f
> 
> the next step doing:
> 
>  while(tResultSet.next()){
> 
> this error occurs:
> 
>  com.sap.dbtech.jdbc.exceptions.ObjectIsClosedException: SAP DBTech
> JDBC:Object is closed
>         at
> com.sap.dbtech.jdbc.ConnectionSapDB.assertOpen(ConnectionSapDB
> .java:98)
>         at
> com.sap.dbtech.jdbc.ConnectionSapDB.execute(ConnectionSapDB.java:289)
>         at
> com.sap.dbtech.jdbc.ConnectionSapDB.execute(ConnectionSapDB.java:272)
>         at
> com.sap.dbtech.jdbc.FetchInfo.executeFetchByAdbs(FetchInfo.java:362)
>         at
> com.sap.dbtech.jdbc.ResultSetSapDB.doFetch(ResultSetSapDB.java:267)
>         at
> com.sap.dbtech.jdbc.ResultSetSapDB.fetchRelativePacket(ResultS
> etSapDB.java:577)
> 
>         at
> com.sap.dbtech.jdbc.ResultSetSapDB.relative(ResultSetSapDB.java:1549)
>         at
> com.sap.dbtech.jdbc.ResultSetSapDB.next(ResultSetSapDB.java:1475)
>       ...
> 
> 
> The connection is closed before the resultset is read out. Do 
> we need to
> have an open connection?
> Using other databases there wasn't this error.
> 
> Regards
> Jens Panse
> 
> _______________________________________________
> sapdb.general mailing list
> [EMAIL PROTECTED]
> http://listserv.sap.com/mailman/listinfo/sapdb.general
> 
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to