geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Re: EJB 3.1 PFD2 is up for download
Date Wed, 11 Mar 2009 20:09:43 GMT

On Mar 11, 2009, at 12:27 PM, David Blevins wrote:

> The JSR #318 Expert Group has put another Proposed Final Draft (PFD)  
> up for download:
>
> Enterprise JavaBeans 3.1
>
> http://jcp.org/aboutJava/communityprocess/pfd/jsr318/index.html
>
> Note this is still a draft and no the final spec.
>
> Have a look at chapter 22 and see if anything feels familiar.
>
> Essentially this:
>
>   Properties p = new Properties();
>   p.put("java.naming.factory.initial",  
> "org.apache.openejb.client.LocalInitialContextFactory");
>   p.put("movieDatabase", "new://Resource?type=DataSource");
>   p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
>   p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
>
>   p.put("movieDatabaseUnmanaged", "new://Resource?type=DataSource");
>   p.put("movieDatabaseUnmanaged.JdbcDriver", "org.hsqldb.jdbcDriver");
>   p.put("movieDatabaseUnmanaged.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
>   p.put("movieDatabaseUnmanaged.JtaManaged", "false");
>
>   Context context = new InitialContext(p);
>
>   Movies movies = (Movies) context.lookup("MoviesLocal");
>
> Becomes this:
>
>   Properties p = new Properties();
>   p.put("javax.ejb.embeddable.initial",  
> "org.apache.openejb.client.LocalInitialContextFactory");
>   p.put("movieDatabase", "new://Resource?type=DataSource");
>   p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
>   p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");

How do you get from a driver to a datasource?

>
>
>   p.put("movieDatabaseUnmanaged", "new://Resource?type=DataSource");
>   p.put("movieDatabaseUnmanaged.JdbcDriver", "org.hsqldb.jdbcDriver");
>   p.put("movieDatabaseUnmanaged.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
>   p.put("movieDatabaseUnmanaged.JtaManaged", "false");
>
>   EJBContainer container = EJBContainer.createEJBContainer(p);
>
>   Context context = container.getContext();
>
>   Movies movies = (Movies) context.lookup("MoviesLocal");

pretty simple :-)

david jencks
>
>
>
> -David
>


Mime
View raw message