Hi.

Carl Sziebert wrote:
C> Yes, you can just use the DataSource entry in the config file by
C> itself.  I'd suggest that you use vanilla IoC and declare an
C> accessor/mutator pair for the DataSource in your ApplicationAdapter
C> subclass.  Then you'll need to declare the DataSource as a property
C> of your ApplicationAdapter in the  red5-web.xml like so:

C> <bean id="web.handler" class="example.Application" singleton="true">
C>         <property name="dataSource" ref="dataSource" />
C>  </bean>

Thanks you. I use this:

   <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" 
destroy-method="close">
        <property name="driverClassName" value="${jdbc.driverClassName}" />
        <property name="url" value="${jdbc.url}" />
        <property name="username" value="${jdbc.username}" />
        <property name="password" value="${jdbc.password}" />
    </bean>
    
    <bean id="Service.service" class="cz.atomsoft.seznamka.video.Service" 
singleton="true" >
      <property name="dataSource" ref="dataSource" />
    </bean>


And this workg great.
   

-------------------------- Original message --------------------------
       From: Carl Sziebert <[EMAIL PROTECTED]>
    Subject: [Red5] Red5+Hibernate
       Date: Thursday, October 26, 2006, 2:39:42 AM
Attachments: Zpráva.html, Část.txt
      msgid:[EMAIL PROTECTED]



C> From there you'd just treat it like any old instance variable. 
C> Keep in mind that you'll loose all transactional support provided
C> by Spring and the JTA, so you'll have to manage any rollbacks
C> yourself.  I'd also suggest that you pick up a book on Spring and
C> familiarize yourself with it.  It's pretty slick. 

C> Carl

C> On 10/25/06, Tomáš Procházka <[EMAIL PROTECTED]> wrote:
C>  Hi.

C> Nice example. But too complicated.

C> I need only DataSource and than I use DBUtils:

C>         QueryRunner qr = new QueryRunner(DataConn.getDataSource());
C>         try {
C>             qr.update("...); 
C>         } catch (SQLException ex) {
C>             log.fatal("SQL error",ex);
C>         }

C> But I can obtain datasource in RED5 application?

C> Can I use this

C>         <bean id="dataSource" class="
C> org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
C>         <property name="driverClassName"
C> value="${jdbc.driverClassName}" />
C>         <property name="url" value="${ jdbc.url}" />
C>         <property name="username" value="${jdbc.username}" />
C>         <property name="password" value="${jdbc.password}" />
C>     </bean> 

C> from your code? And how I get datasource in app code?

C> -------------------------- Original message --------------------------
C>        From: Chris Allen <[EMAIL PROTECTED] >
C>     Subject: [Red5] Red5+Hibernate
C>        Date: Tuesday, October 10, 2006, 6:30:15 PM
C> Attachments: <none>
C>       
C> msgid:[EMAIL PROTECTED]

C>> Carl,

C>> I think that Hibernate, Flash and Red5 are a killer combination.
C>> Thanks for putting this together and sharing it with the community. I 
C>> will take a look at it when I get a chance.

C>> -Chris

C>> On 10/9/06, Carl Sziebert <[EMAIL PROTECTED]> wrote:
>>> All:

>>> I've written a small test/example app which demonstrates connecting to a 
>>> MySQL database via Hibernate to do simple authentication of a new client
>>> connecting to a Red5 application.  Everything is wired together using Spring
>>> and only the necessary JARs are provided in the lib directory.  The app 
>>> ONLY 
>>> runs on the latest code from SVN and it's a bit involved to get working, but
>>> I thought it was worth sharing with the community.  Paul G. has verified
>>> that it works under both Jetty and Tomcat.  See the included readme for 
>>> (minimal) setup instructions.

>>> To use the application as provided, all you will need to do is drop the
>>> 'WEB-INF' directory into a Red5 application directory named 'hibernate'.
>>> Make sure that you've got MySQL running and configured correctly with the 
>>> info provided.  After that you can test your install with the simple client
>>> I've provided (swf/dist/test.html).

>>> http://sziebert.net/software/examples/Red5+Hibernate.zip 

>>> Carl
>>> --
>>> Be who you are and say what you feel, because those who mind don't matter
>>> and those who matter don't mind.
>>>   - Dr. Seuss
>>> _______________________________________________ 
>>> Red5 mailing list
>>> [email protected]
>>> http://osflash.org/mailman/listinfo/red5_osflash.org 




C>> _______________________________________________
C>> Red5 mailing list
C>> [email protected]
C>>  http://osflash.org/mailman/listinfo/red5_osflash.org

C> ----------------------- End of original message ----------------------

C> --
C>  Tomas Prochazka


C> _______________________________________________ 
C> Red5 mailing list
C> [email protected]
C> http://osflash.org/mailman/listinfo/red5_osflash.org

C>  



----------------------- End of original message ----------------------

-- 
 Tomas Prochazka


_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org

Reply via email to