tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mauro2java2011 <>
Subject declare datasource into tomee.xml with variable env of mysql Openshift
Date Sat, 01 Feb 2014 17:51:42 GMT
hi. i would i*install tomee* with diy into openshift. from :

ON openshift i would active  also mysql  .

>From openshift i can get the value of variable env of db and other .

NOw i would create into tomee.xml a Reosuce for a datasource without hard
code the value , but use the variable env .

Like i have to make it?
i have to export a Variable env woth the -Dproerties that reference at
$(OPENSHIFT_MYSQL_host , and into tomee.xml referce it with:

openshift variables available for mysql:
OPENSHIFT_MYSQL_DB_HOST 	The hostname or IP address to use to
connect to 
OPENSHIFT_MYSQL_DB_PORT 	3306 	The port your database server is listening on
OPENSHIFT_MYSQL_DB_USERNAME 	admin 	Your database administrative username

into the 
openshift-tomcat-quickstart /.openshift /action_hooks /start file that it is
called from the openshift when i push , i have to add:

-Dmydburl=$OPENSHIFT_MYSQL_DB_URL"  ?????

 FOR get the values into java  system properties -

And into the tomee.xml , into the declaration of resource of db:

<Resource id="myapp_mysqDBl" type="DataSource">
  JdbcDriver  com.mysql.jdbc.Driver
  JdbcUrl   ${mydburl}
  UserName    ${mydbusername}
  Password  ${mydbpassword}
  JtaManaged true

Then  from the persistence.xmol into my web apps i reference only with :

PLEase the procedure it is correct of  

-Dmydburl=$OPENSHIFT_MYSQL_DB_URL"  ?????*
and referecne at properties int othe tomee.xml  ?

View this message in context:
Sent from the OpenEJB User mailing list archive at

View raw message