title: Openshift JNDI jdbc
body: <p>Im trying to get connection to my database(MYSQL) in openshift, using JNDI.
  Once i get connection i make my transactions by jdbc connection.
  I dont use hibernate, or any kind of container, just simple JDBC with statments,etc..</p>
  
  <p>I looked to my standalone.xml, and like always that file has a datasource mysql, so i wrote my code like this.</p>
  
  <pre><code>String jndiName = "java:jboss/datasources/MySQLDS";
  
  Context ic = new InitialContext();
  Object obj = ic.lookup(jndiName);
  javax.sql.DataSource ds = (javax.sql.DataSource) obj;
  Connection con = ds.getConnection();
  </code></pre>
  
  <p>Commited my code to openshift server and tryied to execute my code.
  First time i got connection for my database, but the second time,third,and so on, i got an error, saying that datasource doesnt exist..</p>
  
  <p>Edit: error log</p>
  
  <p>Unable to get managed connection for "java:jboss/datasources/MySQLDS"</p>