Announcement Announcement Module
Collapse
No announcement yet.
Dynamically changing jdbc settings Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment


    • #3
      (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?

      Comment


      • #4
        [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).

        Comment


        • #5
          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?

          Comment


          • #6
            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?

            Comment

            Working...
            X