Results 1 to 6 of 6

Thread: Dynamically changing jdbc settings

Hybrid View

  1. #1
    Join Date
    Feb 2006
    Posts
    17

    Default Dynamically changing jdbc settings

    I have a server and client application. Client is done in swing, and I use spring RMI to access the service methods on the server.

    I'd like to redesign my server application so that when we deploy the application on different sites, I don’t have reverse engineer domain objects, or copy the entire server per site. This would cause huge management problems when we need to implement a simple change.

    The project needs to have JDBC libraries set dynamically based on not only what company the project is deployed at but also what user logs into the client (so the client app will dictate which libraries need to be included). A single server running at the client site on a single machine needs to handle different companies. I guess my question is, what is the best way to change the JDBC url while the server is up and running?

    Any help would be appreciated. Thanks.

  2. #2
    Join Date
    Aug 2006
    Location
    Now Germany, previously Ukraine
    Posts
    1,546

    Default

    AbstractRoutingDataSource may satisfy your needs, look here
    http://blog.interface21.com/main/200...ource-routing/

    If you need more info, search in Data Access forum, this topic is discussed there each few monthes.

    Regards,
    Oleksandr

  3. #3
    Join Date
    Feb 2006
    Posts
    17

    Default

    (I guess this isn't the correct place for my question. anyone feel free to move it to the correct location).

    Thanks for the link olek. very good article.

    also searching i found this post: http://forum.springframework.org/showthread.php?t=24300

    This is excatly what I'd like to do (a service program on the AS/400 will determine the datasource). In the blog entry the datasources are predefined, but I'd like to set it dynamically. is there a updated solution using the solution bill suggested in the first link, but using this new class in spring?

  4. #4
    Join Date
    Aug 2006
    Location
    Now Germany, previously Ukraine
    Posts
    1,546

    Default

    [QUOTE=llpind;141150](I guess this isn't the correct place for my question. anyone feel free to move it to the correct location).

    Thanks for the link olek. very good article.

    ...QUOTE]

    As far as I can see, techique used in the blog post does not rely on the fact that datasources are known in advance. It really does not matter if datasource is looked up from map or delivered by your service program (or created by you based on the data from those service program).

  5. #5
    Join Date
    Feb 2006
    Posts
    17

    Default

    Ok. I will implement this.

    when a client logs in, gets its JDBC library list from the server. how is this stored for that clients own datasource, while other clients are also hitting the server demanding different datasources?
    ThreadLocal is handling this? can someone explain how this works please?

  6. #6
    Join Date
    Feb 2006
    Posts
    17

    Default

    Once a user has logged in, I'd like to keep the same library list for that user throughout that run. anyway i can save this by client?

Posting Permissions

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