1 Reply Latest reply on Aug 25, 2002 1:14 AM by David Jencks

    JBoss 3.0.1 Dynamic Database & DataSource Creation

    Carles Pairot Newbie

      Hi all,

      I have a Project Entity Bean that whenever it is created, it should also create a new Database which would contain many of its data, that means that every Project would be mapped to an entire database.

      The problem is the dynamic database creation: is there any way of doing this? I do not know whether it is possible to do so by creating a Resource Adaptor that accesses a MySQL Database (for example), creates the DB and then it returns the newly-created DataSource.

      Any ideas would be of great help.

      Thanks in advance.


        • 1. Re: JBoss 3.0.1 Dynamic Database & DataSource Creation
          David Jencks Master

          This is not the role of a resource adapter. If you use firebird there is an mbean you can use to create databases dynamically. You could probably write something similar for other dbs if they provide a java interface for database creation.

          You don't provide enough info about how other entities decide which database to access. Are you sure it wouldn't be more appropriate to have one database where most tables have a projectid column?