| |
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <HTML> |
| <HEAD> |
| <!-- $PAGETITLE --> |
| <TITLE>OpenEJB - Injection of DataSource Example</TITLE> |
| <LINK href="http://openejb.apache.org/all.css" rel="stylesheet" type="text/css"> |
| <!--[if IE]><link rel="stylesheet" type="text/css" media="screen, projection" href="openejb.apache.org/ie.css"><![endif]--> |
| |
| <LINK rel="SHORTCUT ICON" href="http://openejb.apache.org/images/favicon.ico"> |
| <META http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
| </HEAD> |
| <BODY> |
| |
| <!-- Delay the loading of the external javascript file needed for labels (as it takes too long to load and visibly holds loading of the page body) --> |
| <!-- To do this without javascript errors over undefined functions, we need to declare stubs here (that are overrided later by the proper implementations) --> |
| <SCRIPT language="JavaScript" type="text/javascript"> |
| function doAddLabel(hideTextfieldAfterAddParam) |
| { |
| // stub |
| } |
| |
| function onAddLabel() |
| { |
| // stub |
| } |
| |
| function showLabelsInput() |
| { |
| // stub |
| } |
| </SCRIPT> |
| |
| <A name="top"></A> |
| <TABLE class="frameTable" cellpadding="0" cellspacing="0" border="0"> |
| <TR class="Row1"> |
| <TD class="Col1"><IMG alt="" src="http://openejb.apache.org/images/dotTrans.gif"></TD> |
| <TD class="Col2"><IMG alt="" src="http://openejb.apache.org/images/dotTrans.gif"></TD> |
| <TD class="Col3"><IMG alt="" src="http://openejb.apache.org/images/dotTrans.gif"></TD> |
| <TD class="Col4"><IMG alt="" src="http://openejb.apache.org/images/dotTrans.gif"></TD> |
| <TD class="Col5"><IMG alt="" src="http://openejb.apache.org/images/dotTrans.gif"></TD> |
| </TR> |
| <TR class="Row2"> |
| <TD class="Col1"><IMG alt="" src="http://openejb.apache.org/images/dotTrans.gif"></TD> |
| <TD class="Col2"> </TD> |
| <TD class="Col3" id="breadcrumbs"> |
| <!-- $TOP_NAV_BAR --> |
| <A href="../OPENEJB/index.html" title="Index">Home</A> | <A href="../OPENEJB/download.html" title="Download">Download</A> | <A href="../OPENEJB/mailing-lists.html" title="Mailing Lists">Lists</A> | <A href="http://issues.apache.org/jira/browse/OPENEJB" class="external-link" rel="nofollow">Issues</A> |
| |
| </TD> |
| <TD class="Col4"><IMG alt="" src="http://openejb.apache.org/images/dotTrans.gif"></TD> |
| <TD class="Col5"> </TD> |
| </TR> |
| <TR class="Row3"> |
| <TD class="Col1"><IMG alt="" class="Row3Img" id="thinLine" src="http://openejb.apache.org/images/line_sm.gif"></TD> |
| <TD class="Col2"><IMG alt="" class="Row3Img" src="http://openejb.apache.org/images/dotTrans.gif"></TD> |
| <TD class="Col3"><IMG alt="" class="Row3Img" src="http://openejb.apache.org/images/dotTrans.gif"></TD> |
| <TD class="Col4"><IMG alt="" src="http://openejb.apache.org/images/dotTrans.gif"></TD> |
| <TD class="Col5"><IMG alt="" class="Row3Img" src="http://openejb.apache.org/images/dotTrans.gif"></TD> |
| </TR> |
| <TR class="Row4"> |
| <TD class="Col1"> |
| <SPAN id="Navigation"> |
| |
| <H3><A name="Navigation-Overview"></A>Overview</H3> |
| |
| <UL class="alternate" type="square"> |
| <LI><A href="../OPENEJB/index.html" title="Index">Home</A></LI> |
| <LI><A href="../OPENEJB/news.html" title="News">News</A></LI> |
| <LI><A href="../OPENEJB/faq.html" title="FAQ">FAQ</A></LI> |
| <LI><A href="../OPENEJB/download.html" title="Download">Download</A></LI> |
| <LI><A href="index.html" title="Index">Documentation</A></LI> |
| <LI><A href="../OPENEJB/examples.html" title="Examples">Examples</A></LI> |
| <LI><A href="http://cwiki.apache.org/confluence/display/OPENEJB/Lightening%20Demos" class="external-link" rel="nofollow">Lightning Demos</A></LI> |
| <LI><A href="../OPENEJB/mailing-lists.html" title="Mailing Lists">Mailing Lists</A></LI> |
| <LI><A href="../OPENEJB/source-code.html" title="Source Code">Source Code</A></LI> |
| <LI><A href="http://blogs.apache.org/openejb" class="external-link" rel="nofollow">Project Blog</A></LI> |
| </UL> |
| |
| |
| <H3><A name="Navigation-Servers"></A>Servers</H3> |
| |
| <UL class="alternate" type="square"> |
| <LI><A href="../OPENEJB/local-server.html" title="Local Server">Local</A></LI> |
| <LI><A href="../OPENEJB/remote-server.html" title="Remote Server">Remote</A></LI> |
| </UL> |
| |
| |
| <H3><A name="Navigation-Integrations"></A>Integrations</H3> |
| |
| <UL class="alternate" type="square"> |
| <LI><A href="tomcat.html" title="Tomcat">Tomcat</A></LI> |
| <LI><A href="../OPENEJB/geronimo.html" title="Geronimo">Geronimo</A></LI> |
| <LI><A href="../OPENEJB/webobjects.html" title="WebObjects">WebObjects</A></LI> |
| </UL> |
| |
| |
| <H3><A name="Navigation-Community"></A>Community</H3> |
| |
| <UL class="alternate" type="square"> |
| <LI><A href="../OPENEJB/team.html" title="Team">Team</A></LI> |
| <LI><A href="../OPENEJB/articles.html" title="Articles">Articles</A></LI> |
| <LI><A href="http://webchat.freenode.net/?channels=openejb" class="external-link" rel="nofollow">IRC</A></LI> |
| </UL> |
| |
| |
| <H3><A name="Navigation-RelatedProjects"></A>Related Projects</H3> |
| |
| <UL class="alternate" type="square"> |
| <LI><A href="http://activemq.apache.org/" class="external-link" rel="nofollow">ActiveMQ</A></LI> |
| <LI><A href="http://openjpa.apache.org/" class="external-link" rel="nofollow">OpenJPA</A></LI> |
| <LI><A href="http://cxf.apache.org/" class="external-link" rel="nofollow">CXF</A></LI> |
| </UL> |
| |
| |
| <H3><A name="Navigation-Index"></A>Index</H3> |
| <UL class="alternate" type="square"> |
| <LI><A href="../OPENEJB/space-index.html" title="Space Index">Site Index</A></LI> |
| <LI><A href="space-index.html" title="Space Index">Doc Index</A></LI> |
| </UL> |
| |
| <H3> |
| <A name="Navigation-Feeds"></A> |
| Feeds |
| </H3> |
| |
| <UL class="feeds"> |
| <LI> |
| <A href="http://cwiki.apache.org/confluence/spaces/rss.action?key=OPENEJB&newPages=false"> |
| <IMG src="http://openejb.apache.org/images/rss.gif"></A> |
| <A class="feedsText" href="http://cwiki.apache.org/confluence/spaces/rss.action?key=OPENEJB&newPages=false">Site</A> |
| </LI> |
| |
| <LI><A href="http://cwiki.apache.org/confluence/spaces/blogrss.action?key=OPENEJB"> |
| <IMG src="http://openejb.apache.org/images/rss.gif"></A> |
| <A class="feedsText" href="http://cwiki.apache.org/confluence/spaces/blogrss.action?key=OPENEJB">News</A> |
| </LI> |
| </UL> |
| </SPAN> |
| </TD> |
| <TD class="Col2"> </TD> |
| <TD class="Col3"> |
| <TABLE id="PageHeader" border="0" width="100%"> |
| <TR> |
| <TD> |
| <A href="http://openejb.org/"> |
| <IMG hspace="0" src="http://openejb.apache.org/images/logo_openejb.gif" vspace="0"> |
| </A> |
| </TD> |
| <TD align="right"> |
| <A href="http://www.apache.org/"> |
| <IMG src="http://www.apache.org/images/asf-logo.gif" width="258" height="66"> |
| </A> |
| </TD> |
| </TR> |
| <TR> |
| <TD id="page_title"> |
| <!-- $TITLE --> |
| Injection of DataSource Example |
| </TD> |
| |
| <TD align="right"> |
| <BR><BR> |
| <!-- Google CSE Search Box Begins --> |
| <FORM id="searchbox_010475492895890475512:_t4iqjrgx90" action="http://www.google.com/cse"> |
| <INPUT type="hidden" name="cx" value="010475492895890475512:_t4iqjrgx90"> |
| <INPUT type="hidden" name="cof" value="FORID:0"> |
| <INPUT name="q" type="text" size="25"> |
| <INPUT type="submit" name="sa" value="Search"> |
| </FORM> |
| <SCRIPT type="text/javascript" src="http://www.google.com/coop/cse/brand?form=searchbox_010475492895890475512:_t4iqjrgx90"></SCRIPT> |
| <!-- Google CSE Search Box Ends --> |
| |
| </TD> |
| </TR> |
| </TABLE> |
| <P> |
| <!-- $BODY --> |
| <DIV id="PageContent"> |
| <H1><A name="InjectionofDataSourceExample-Overview"></A>Overview</H1> |
| |
| <P><SPAN style="float: right; margin-left: 20px;"> |
| |
| <OBJECT width="400" height="250"><PARAM name="movie" value="http://www.youtube.com/v/g3lIPlegDJk?fs=1&hl=en_US&rel=0"></PARAM><PARAM name="allowFullScreen" value="true"></PARAM><PARAM name="allowscriptaccess" value="always"></PARAM><EMBED src="http://www.youtube.com/v/g3lIPlegDJk?fs=1&hl=en_US&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="400" height="250"></EMBED></OBJECT> |
| |
| </SPAN></P> |
| <DIV><P>In this example we use the <B>@Resource</B> annotation to inject a <B>javax.sql.DataSource</B> into our bean. The trickiest thing about injecting a DataSource is not declaring the annotation, but actually configuring the data source.</P> |
| |
| <P>In OpenEJB the rules are quite simple. An declaration like the following in code:</P> |
| |
| <DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent"> |
| <PRE class="code-java"> |
| @Resource DataSource customerDataSource; |
| </PRE> |
| </DIV></DIV> |
| |
| <P>Matches a data source declared as follows in the openejb.xml file:</P> |
| |
| <DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent"> |
| <PRE class="code-java"> |
| <Resource type=<SPAN class="code-quote">"DataSource"</SPAN> id=<SPAN class="code-quote">"customerDataSource"</SPAN>> |
| .... |
| </Resource> |
| </PRE> |
| </DIV></DIV> |
| |
| <P>As seen in this example, the data source can also be declared via properties as follows:</P> |
| <DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent"> |
| <PRE class="code-java"> |
| customerDataSource = <SPAN class="code-keyword">new</SPAN>:<SPAN class="code-comment">//Resource?type=DataSource</SPAN> |
| </PRE> |
| </DIV></DIV> |
| |
| <P>This style of properties creation can be used in the InitialContext properties, set into the System properties, or passed in on the command line as vm properties.</P> |
| |
| <P><EM>The source for this example is in the "injection-of-datasource" directory located in the <A href="../OPENEJB/download.html" title="Download">openejb-examples.zip</A> available on the download page.</EM></P></DIV> |
| <DIV style="clear:both;"></DIV> |
| |
| <H1><A name="InjectionofDataSourceExample-TheCode"></A>The Code</H1> |
| |
| <DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent"> |
| <PRE class="code-java"><SPAN class="code-keyword">package</SPAN> org.superbiz.injection; |
| |
| <SPAN class="code-keyword">import</SPAN> javax.annotation.PostConstruct; |
| <SPAN class="code-keyword">import</SPAN> javax.annotation.Resource; |
| <SPAN class="code-keyword">import</SPAN> javax.ejb.Stateful; |
| <SPAN class="code-keyword">import</SPAN> javax.sql.DataSource; |
| <SPAN class="code-keyword">import</SPAN> java.sql.Connection; |
| <SPAN class="code-keyword">import</SPAN> java.sql.PreparedStatement; |
| <SPAN class="code-keyword">import</SPAN> java.sql.ResultSet; |
| <SPAN class="code-keyword">import</SPAN> java.util.List; |
| <SPAN class="code-keyword">import</SPAN> java.util.ArrayList; |
| |
| @Stateful(name = <SPAN class="code-quote">"Movies"</SPAN>) |
| <SPAN class="code-keyword">public</SPAN> class MoviesImpl <SPAN class="code-keyword">implements</SPAN> Movies { |
| |
| /** |
| * The field name <SPAN class="code-quote">"movieDatabase"</SPAN> matches the DataSource we |
| * configure in the TestCase via : |
| * p.put(<SPAN class="code-quote">"movieDatabase"</SPAN>, <SPAN class="code-quote">"<SPAN class="code-keyword">new</SPAN>:<SPAN class="code-comment">//Resource?type=DataSource"</SPAN>); |
| </SPAN> * |
| * This would also match an equivalent delcaration in an openejb.xml: |
| * <Resource id=<SPAN class="code-quote">"movieDatabase"</SPAN> type=<SPAN class="code-quote">"DataSource"</SPAN>/> |
| * |
| * If you'd like the freedom to change the field name without |
| * impact on your configuration you can set the <SPAN class="code-quote">"name"</SPAN> attribute |
| * of the @Resource annotation to <SPAN class="code-quote">"movieDatabase"</SPAN> instead. |
| */ |
| @Resource |
| <SPAN class="code-keyword">private</SPAN> DataSource movieDatabase; |
| |
| @PostConstruct |
| <SPAN class="code-keyword">private</SPAN> void construct() <SPAN class="code-keyword">throws</SPAN> Exception { |
| Connection connection = movieDatabase.getConnection(); |
| <SPAN class="code-keyword">try</SPAN> { |
| PreparedStatement stmt = connection.prepareStatement(<SPAN class="code-quote">"CREATE TABLE movie ( director VARCHAR(255), title VARCHAR(255), year integer)"</SPAN>); |
| stmt.execute(); |
| } <SPAN class="code-keyword">finally</SPAN> { |
| connection.close(); |
| } |
| } |
| |
| <SPAN class="code-keyword">public</SPAN> void addMovie(Movie movie) <SPAN class="code-keyword">throws</SPAN> Exception { |
| Connection conn = movieDatabase.getConnection(); |
| <SPAN class="code-keyword">try</SPAN> { |
| PreparedStatement sql = conn.prepareStatement(<SPAN class="code-quote">"INSERT into movie (director, title, year) values (?, ?, ?)"</SPAN>); |
| sql.setString(1, movie.getDirector()); |
| sql.setString(2, movie.getTitle()); |
| sql.setInt(3, movie.getYear()); |
| sql.execute(); |
| } <SPAN class="code-keyword">finally</SPAN> { |
| conn.close(); |
| } |
| } |
| |
| <SPAN class="code-keyword">public</SPAN> void deleteMovie(Movie movie) <SPAN class="code-keyword">throws</SPAN> Exception { |
| Connection conn = movieDatabase.getConnection(); |
| <SPAN class="code-keyword">try</SPAN> { |
| PreparedStatement sql = conn.prepareStatement(<SPAN class="code-quote">"DELETE from movie where director = ? AND title = ? AND year = ?"</SPAN>); |
| sql.setString(1, movie.getDirector()); |
| sql.setString(2, movie.getTitle()); |
| sql.setInt(3, movie.getYear()); |
| sql.execute(); |
| } <SPAN class="code-keyword">finally</SPAN> { |
| conn.close(); |
| } |
| } |
| |
| <SPAN class="code-keyword">public</SPAN> List<Movie> getMovies() <SPAN class="code-keyword">throws</SPAN> Exception { |
| ArrayList<Movie> movies = <SPAN class="code-keyword">new</SPAN> ArrayList<Movie>(); |
| Connection conn = movieDatabase.getConnection(); |
| <SPAN class="code-keyword">try</SPAN> { |
| PreparedStatement sql = conn.prepareStatement(<SPAN class="code-quote">"SELECT director, title, year from movie"</SPAN>); |
| ResultSet set = sql.executeQuery(); |
| <SPAN class="code-keyword">while</SPAN> ( set.next() ) { |
| Movie movie = <SPAN class="code-keyword">new</SPAN> Movie(); |
| movie.setDirector(set.getString(<SPAN class="code-quote">"director"</SPAN>)); |
| movie.setTitle(set.getString(<SPAN class="code-quote">"title"</SPAN>)); |
| movie.setYear(set.getInt(<SPAN class="code-quote">"year"</SPAN>)); |
| movies.add( movie ); |
| } |
| |
| } <SPAN class="code-keyword">finally</SPAN> { |
| conn.close(); |
| } |
| <SPAN class="code-keyword">return</SPAN> movies; |
| } |
| |
| } |
| </PRE> |
| </DIV></DIV> |
| |
| <H1><A name="InjectionofDataSourceExample-Writingaunittestfortheexample"></A>Writing a unit test for the example</H1> |
| |
| <DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent"> |
| <PRE class="code-java"><SPAN class="code-keyword">public</SPAN> class MoviesTest <SPAN class="code-keyword">extends</SPAN> TestCase { |
| |
| <SPAN class="code-keyword">public</SPAN> void test() <SPAN class="code-keyword">throws</SPAN> Exception { |
| Properties p = <SPAN class="code-keyword">new</SPAN> Properties(); |
| p.put(Context.INITIAL_CONTEXT_FACTORY, <SPAN class="code-quote">"org.apache.openejb.client.LocalInitialContextFactory"</SPAN>); |
| p.put(<SPAN class="code-quote">"movieDatabase"</SPAN>, <SPAN class="code-quote">"<SPAN class="code-keyword">new</SPAN>:<SPAN class="code-comment">//Resource?type=DataSource"</SPAN>); |
| </SPAN> p.put(<SPAN class="code-quote">"movieDatabase.JdbcDriver"</SPAN>, <SPAN class="code-quote">"org.hsqldb.jdbcDriver"</SPAN>); |
| p.put(<SPAN class="code-quote">"movieDatabase.JdbcUrl"</SPAN>, <SPAN class="code-quote">"jdbc:hsqldb:mem:moviedb"</SPAN>); |
| |
| Context context = <SPAN class="code-keyword">new</SPAN> InitialContext(p); |
| |
| Movies movies = (Movies) context.lookup(<SPAN class="code-quote">"MoviesLocal"</SPAN>); |
| |
| movies.addMovie(<SPAN class="code-keyword">new</SPAN> Movie(<SPAN class="code-quote">"Quentin Tarantino"</SPAN>, <SPAN class="code-quote">"Reservoir Dogs"</SPAN>, 1992)); |
| movies.addMovie(<SPAN class="code-keyword">new</SPAN> Movie(<SPAN class="code-quote">"Joel Coen"</SPAN>, <SPAN class="code-quote">"Fargo"</SPAN>, 1996)); |
| movies.addMovie(<SPAN class="code-keyword">new</SPAN> Movie(<SPAN class="code-quote">"Joel Coen"</SPAN>, <SPAN class="code-quote">"The Big Lebowski"</SPAN>, 1998)); |
| |
| List<Movie> list = movies.getMovies(); |
| assertEquals(<SPAN class="code-quote">"List.size()"</SPAN>, 3, list.size()); |
| |
| <SPAN class="code-keyword">for</SPAN> (Movie movie : list) { |
| movies.deleteMovie(movie); |
| } |
| |
| assertEquals(<SPAN class="code-quote">"Movies.getMovies()"</SPAN>, 0, movies.getMovies().size()); |
| } |
| } |
| </PRE> |
| </DIV></DIV> |
| |
| <P>Note in the above test code the following lines:</P> |
| <DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent"> |
| <PRE class="code-java"> |
| p.put(<SPAN class="code-quote">"movieDatabase"</SPAN>, <SPAN class="code-quote">"<SPAN class="code-keyword">new</SPAN>:<SPAN class="code-comment">//Resource?type=DataSource"</SPAN>); |
| </SPAN>p.put(<SPAN class="code-quote">"movieDatabase.JdbcDriver"</SPAN>, <SPAN class="code-quote">"org.hsqldb.jdbcDriver"</SPAN>); |
| p.put(<SPAN class="code-quote">"movieDatabase.JdbcUrl"</SPAN>, <SPAN class="code-quote">"jdbc:hsqldb:mem:moviedb"</SPAN>); |
| </PRE> |
| </DIV></DIV> |
| |
| <P>As mentioned these actually create and configure the data source. When OpenEJB boots up, these properties will get read and executed allowing you to keep all the configuration required to run your tests right in the test case itself. No need to keep dozens of openejb.xml config files in your projects or try and create one big configuration that might end up loading a lot of unneeded containers and resources. </P> |
| |
| <P>In your production system you can place the properties into the OPENEJB_HOME/conf/system.properties file or add them to your OPENEJB_HOME/conf/openejb.xml with a declaration like so:</P> |
| |
| <DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent"> |
| <PRE class="code-xml"> |
| <SPAN class="code-tag"><Resource type=<SPAN class="code-quote">"DataSource"</SPAN> id=<SPAN class="code-quote">"movieDatabase"</SPAN>></SPAN> |
| JdbcDriver = org.hsqldb.jdbcDriver |
| JdbcUrl = jdbc:hsqldb:mem:moviedb |
| <SPAN class="code-tag"></Resource></SPAN> |
| </PRE> |
| </DIV></DIV> |
| |
| <H1><A name="InjectionofDataSourceExample-Running"></A>Running</H1> |
| |
| <P>Running the example is fairly simple. In the "injection-of-datasource" directory of the <A href="../OPENEJB/download.html" title="Download">examples zip</A>, just run:</P> |
| |
| <BLOCKQUOTE> |
| <P>$ mvn clean install</P></BLOCKQUOTE> |
| |
| <P>Which should create output like the following.</P> |
| |
| <DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent"> |
| <PRE>------------------------------------------------------- |
| T E S T S |
| ------------------------------------------------------- |
| Running org.superbiz.injection.MoviesTest |
| Apache OpenEJB 3.0 build: 20080408-04:13 |
| http://openejb.apache.org/ |
| INFO - openejb.home = /Users/dblevins/work/openejb-3.0/examples/injection-of-datasource |
| INFO - openejb.base = /Users/dblevins/work/openejb-3.0/examples/injection-of-datasource |
| INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service) |
| INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager) |
| INFO - Configuring Service(id=movieDatabase, type=Resource, provider-id=Default JDBC Database) |
| INFO - Configuring Service(id=Default JDK 1.3 ProxyFactory, type=ProxyFactory, provider-id=Default JDK 1.3 ProxyFactory) |
| INFO - Found EjbModule in classpath: /Users/dblevins/work/openejb-3.0/examples/injection-of-datasource/target/classes |
| INFO - Configuring app: /Users/dblevins/work/openejb-3.0/examples/injection-of-datasource/target/classes |
| INFO - Configuring Service(id=Default Stateful Container, type=Container, provider-id=Default Stateful Container) |
| INFO - Auto-creating a container for bean Movies: Container(type=STATEFUL, id=Default Stateful Container) |
| INFO - Auto-linking resource-ref 'org.superbiz.injection.MoviesImpl/movieDatabase' in bean Movies to Resource(id=movieDatabase) |
| INFO - Loaded Module: /Users/dblevins/work/openejb-3.0/examples/injection-of-datasource/target/classes |
| INFO - Assembling app: /Users/dblevins/work/openejb-3.0/examples/injection-of-datasource/target/classes |
| INFO - Jndi(name=MoviesLocal) --> Ejb(deployment-id=Movies) |
| INFO - Created Ejb(deployment-id=Movies, ejb-name=Movies, container=Default Stateful Container) |
| INFO - Deployed Application(path=/Users/dblevins/work/openejb-3.0/examples/injection-of-datasource/target/classes) |
| Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.911 sec |
| |
| Results : |
| |
| Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 |
| |
| </PRE> |
| </DIV></DIV> |
| |
| </DIV> |
| </P> |
| </TD> |
| <TD class="Col4"><IMG src="http://openejb.apache.org/images/dotTrans.gif"></TD> |
| <TD class="Col5"> |
| |
| |
| </TD> |
| </TR> |
| <TR class="Row5"> |
| <TD class="Col1"> </TD> |
| <TD class="Col2"> </TD> |
| <TD class="Col3"> |
| <BR> |
| <BR> |
| <IMG width="100%" height="1" src="http://openejb.apache.org/images/line_light.gif"> |
| <TABLE width="100%"> |
| <TR> |
| <TD> |
| <SPAN class="bodyGrey"> |
| <SMALL> |
| <NOTICE><!-- $FOOTER --> |
| Apache OpenEJB is an project of The Apache Software Foundation (ASF) |
| </NOTICE> |
| <BR> |
| Site Powered by |
| <A href="http://atlassian.com/">Atlassian</A> |
| <A href="http://atlassian.com/confluence/">Confluence</A> |
| . |
| </SMALL> |
| </SPAN> |
| </TD> |
| <TD align="right"> |
| <A style="color:#999;font-size:small;font-weight:normal;" href="https://cwiki.apache.org/confluence/pages/editpage.action?spaceKey=OPENEJBx30&title=Injection%20of%20DataSource%20Example">[ edit ]</A> |
| </TD> |
| </TR> |
| </TABLE> |
| <BR> |
| </TD> |
| <TD class="Col4"><IMG src="http://openejb.apache.org/images/dotTrans.gif"></TD> |
| <TD class="Col5"> </TD> |
| </TR> |
| </TABLE> |
| |
| <!-- Needed for composition plugin --> |
| <!-- delay the loading of large javascript files to the end so that they don't interfere with the loading of page content --> |
| <SPAN style="display: none"> |
| <SCRIPT type="text/javascript" language="JavaScript" src="http://cwiki.apache.org/confluence/labels-javascript"></SCRIPT> |
| |
| <SCRIPT src="http://www.google-analytics.com/urchin.js" type="text/javascript"> |
| </SCRIPT> |
| <SCRIPT type="text/javascript"> |
| _uacct = "UA-2717626-1"; |
| urchinTracker(); |
| </SCRIPT> |
| </SPAN> |
| |
| </BODY> |
| </HTML> |