tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laird Nelson <ljnel...@gmail.com>
Subject Putting data source into local container?
Date Mon, 20 Apr 2009 15:23:32 GMT
Hello; I'd like to set up a data source in my embedded OpenEJB container.

Here's my code so far, which results in nothing being bound into the JNDI
tree:

    final Properties properties = new Properties();
    properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
org.apache.openejb.client.LocalInitialContextFactory.class.getName());
    properties.setProperty("jdbc/test", "new://Resource?type=DataSource");
    properties.setProperty("jdbc/test.JdbcDriver", "org.h2.Driver");
    properties.setProperty("jdbc/test.JdbcUrl",
"jdbc:h2:mem:test;DB_CLOSE_DELAY=-1");
    properties.setProperty("jdbc/test.Username", "");
    properties.setProperty("jdbc/test.Password", "");
    properties.put("jdbc/test.DefaultAutoCommit", Boolean.valueOf(false));
    this.context = new InitialContext(properties);

Any ideas?  The context is empty.  I got this recipe from the documentation
on the website.

Best,
Laird

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message