Results 1 to 3 of 3

Thread: How to (dynamically) select a dataSource at dev time ?

  1. #1
    Join Date
    Jun 2005
    Posts
    5

    Default How to (dynamically) select a dataSource at dev time ?

    What I would like to select a database before starting up a server during development (using STS 2.6.1 on XP).

    I have defined several data sources, using " File > New > Other > Connection Profiles > Connection Profile ". These are OracleThinDriver using an ojdbc14.jar . One of them has been designated to connect every time the workbench starts up. They show up in Data Source Explorer and I can Ping them OK. If I select "connect" one, it then does indicate it is in connected status.

    However, it is not used by the server when it starts up. What is being used (and works) is the definition found in the META-INF\context.xml file in my Dynamic Web Project. Even when my project is running on the server, the Data Source Explorer indicates a different db is connected. So it is not in sync with the current server instance.

    Now when I run this project in jDeveloper & oc4j, selecting a data source basically causes the jDev equivalent of context.xml to be rewritten.
    Is there a similar linking mechanism in STS, so I could dynamically select a data source?

  2. #2
    Join Date
    Jan 2012
    Posts
    16

    Default

    if you use Maven to build your project, you can use maven profile to achieve. That's how to switch between dev and production database environments.

  3. #3
    Join Date
    Sep 2008
    Location
    Hamburg, Germany
    Posts
    1,637

    Default

    Hey!

    Aside of that we don't have special support for this in STS, but I guess you could also achieve this via properties that you configure in separate launch configs, so that you have one launch config per database environment.

    HTH,
    Martin
    Martin Lippert
    SpringSource, a division of VMware
    SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/martinlippert

Tags for this Thread

Posting Permissions

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