Results 1 to 2 of 2

Thread: Custom Datasource

  1. #1
    Join Date
    Sep 2004
    Location
    Winterthur, Switzerland
    Posts
    58

    Default Custom Datasource

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

    Background:
    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. #2
    Join Date
    Aug 2004
    Location
    Toronto, Canada
    Posts
    736

    Default

    You might want to look at deriving from DelegatingDataSource, as does UserCredentialsDataSource for example...
    Colin Sampaleanu
    SpringSource - http://www.springsource.com

Similar Threads

  1. Replies: 4
    Last Post: Nov 24th, 2005, 02:38 AM
  2. Odd behaviour when injecting TransactionTemplate
    By damon311 in forum Container
    Replies: 3
    Last Post: Jul 23rd, 2005, 11:21 AM
  3. Replies: 1
    Last Post: Feb 12th, 2005, 07:30 AM
  4. Ignoring missing Jndi DataSource within IDE?
    By Bill Pearce in forum Container
    Replies: 2
    Last Post: Oct 27th, 2004, 09:06 AM
  5. Enlisting Custom DataSource with JTa
    By shaby775 in forum Data
    Replies: 11
    Last Post: Sep 9th, 2004, 03:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •