-
Enhancement
-
Resolution: Duplicate
-
P3
-
None
-
6
-
generic
-
generic
Since Java 5.0 (Tiger) there were introduced JDBC RowSet implementations also known as JSR 114. Now Sun JDK has a number of classes implementing rowset interfaces in com.sun.rowset package. Therefore there are a few problems when the user wants to use this API:
- Java implementation may have one implementation of XxxRowSet interfaces or no ones at all,
- if Java has XxxRowSet interfaces implementation the user should look for fully qualified class name. These classes have different names in various Java implementations. For example BEA didn't publish necessary class names but implemented own factory class. See for details http://e-docs.bea.com/wls/docs90/javadocs/weblogic/jdbc/rowset/RowSetFactory.html
To solve these problems we suggest to introduce Factory class that will have one factory-method for each RowSet interface. For example it may be as following:
public class RowSetFactory {
public CashedRowSet createCashedRowSet();
public FilteredRowSet createFilteredRowSet();
public JdbcRowSet createJdbcRowSet();
public JoinRowSet createJoinRowSet();
public WebRowSet createWebRowSet();
}
Factory method will throw UnsupportedOperationException if there is no corresponding interface implementation.
The advantages we have:
- WORA (write once run anywhere), the API user can run the code in any Java implementation, not only Sun JDK
- the API user don't need to read auxilary documentations to get right class name and a way to instantiate it
###@###.### 2005-05-25 14:02:14 GMT
- Java implementation may have one implementation of XxxRowSet interfaces or no ones at all,
- if Java has XxxRowSet interfaces implementation the user should look for fully qualified class name. These classes have different names in various Java implementations. For example BEA didn't publish necessary class names but implemented own factory class. See for details http://e-docs.bea.com/wls/docs90/javadocs/weblogic/jdbc/rowset/RowSetFactory.html
To solve these problems we suggest to introduce Factory class that will have one factory-method for each RowSet interface. For example it may be as following:
public class RowSetFactory {
public CashedRowSet createCashedRowSet();
public FilteredRowSet createFilteredRowSet();
public JdbcRowSet createJdbcRowSet();
public JoinRowSet createJoinRowSet();
public WebRowSet createWebRowSet();
}
Factory method will throw UnsupportedOperationException if there is no corresponding interface implementation.
The advantages we have:
- WORA (write once run anywhere), the API user can run the code in any Java implementation, not only Sun JDK
- the API user don't need to read auxilary documentations to get right class name and a way to instantiate it
###@###.### 2005-05-25 14:02:14 GMT
- relates to
-
JDK-6373733 The spec should clearly specify the way of instantiation the rowset implementation classes
-
- Closed
-