Announcement Announcement Module
No announcement yet.
Custom Datasource Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Custom Datasource

    What are the trade-offs to have a custom Datasource by extending the AbstractDatasource and implementing for example the SmartDataSource?

    We are using the Springframework with a Oracle database by using the org.springframework.jdbc.* classes and specially the org.springframework.jdbc.object.* to interact with the database.

    The following requirements came up:
    1. To be able to connect to the database, by a oracle name versus by mashine and instance name.
    2. To be able use the oracle username / password as user indentification
    3. To be able to pool connections by oracle username

    The requirement 1. is impossible, the requirement 2. / 3. seems to be at least to be difficult with the oracle thin jdbc driver, since it knows nothing about oracle net .

    Which lead - rightly? - to the conclusion to use the oci driver and oracle specific classes (OracleConnection, OracleOCIConnectionPool and maybe others).

    Our approach would be to subclass AbstractDataSource and implement the SmartDataSource Interface. Does this make sense? Does anybody see some problems right away, which would'nt make the approach?
    Or better: has somebody done something similiar and would be willing the share experience and/ or code ;-)

    Any Feedback greatly appreciated.
    Christoph Henrici

  • #2
    You might want to look at deriving from DelegatingDataSource, as does UserCredentialsDataSource for example...