From: "Jeremy Boynes" <[EMAIL PROTECTED]>
With the JDBC 2.0 extension and 3.0, DataSource became available as the preferred mechanism. Ideally this would be via JNDI lookup (although there is no standard provider and/or location for the binding in J2SE), but as an alternative configuration can now be done using standard JavaBean semantics (e.g. hard coding get/set calls, serialization (.ser file), XML storage, reflection in conjunction with PropertyEditors, etc.) This provides much more flexibility than specialized Driver code.
I think there is already a solution for this - to use a framework such as Spring. DataSources can presumably be registered as beans, and injected
into client code without any need to know what the implementation looks
like.
Yes - in most cases (J2EE or with a framework like Spring) the user will never actually see the underlying implementation and would only be using the DataSource interface. This is the usage model recommended in the spec.
However, in some cases the application code will be creating the connection factory directly. I continue to believe this is easier using the JavaBean model with a DataSource implementation than with the legacy DriverManager model.
-- Jeremy
