This content has been marked as final.
Show 2 replies
-
1. Re: Creating JDBC Datasources/Conn Pools from the cmd line?
peterj Aug 19, 2008 1:41 PM (in response to plowmon)The best way to create a datasource is to:
1) Create a *-ds.xml file
2) Copy/move the file to the deploy directory
In my build process, I have a generic *-ds.xml file that contains properties for various items. For example:<jndi-name>${db.datasource}</jndi-name> <connection-url>${db.url.base}${db.database}</connection-url>
Then in my Ant script, or properties file, I set the db.* properties and I copy the file as follows:<copy file="${db.dsxml}" tofile="${dir.deploy}/${jboss.server}-${database.type}-ds.xml" > <filterchain> <expandproperties /> </filterchain> </copy>
My Ant script is set up to allow the MySQL, PostgreSQL or Hypersonic databases. Every aspect of the datasource is configurable from the database name down to the user name and password. I can easily switch from using PostgreSQL to MySQL - it is a one-line properties file change. -
2. Re: Creating JDBC Datasources/Conn Pools from the cmd line?
plowmon Aug 19, 2008 3:45 PM (in response to plowmon)Thanks! I had tried that before but just realized after reading your post that my second attempt at doing this had an error, I named the file mydatasource-ds2.xml instead of mydatasource2.xml
:D