Announcement Announcement Module
Collapse
No announcement yet.
How to (dynamically) select a dataSource at dev time ? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

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

    Comment


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

      Comment

      Working...
      X