Hi.

I used finally this id red5-web.xml

   <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 in Service class a defined this:

        public void setDataSource(DataSource datasource)
        {
                this.datasource = datasource;
        }
    

And for SQL I'm using Apache DBUtils:

  QueryRunner qr = new QueryRunner(datasource);
  qr.update("....",param);

And it works great.

-------------------------- Original message --------------------------
       From: Michael Klishin <[EMAIL PROTECTED]>
    Subject: [Red5] use DB connection in RED5 server.
       Date: Thursday, October 26, 2006, 3:10:43 AM
Attachments: <none>
      msgid:[EMAIL PROTECTED]

M> On Wed, 2006-10-25 at 14:30 +0200, Tomáš Procházka wrote:
>> Hi.


>> How is best way to obtain DB connection in RED5 server application?

M> Tomas,

M> First, do you have to use JNDI here? Anyway Spring 2 reference will help
M> you to find out how to obtain database source from JNDI but maybe it's
M> easier to use driver manager datasource that Spring offers, like one for
M> Hibernate?


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

-- 
 Tomas Prochazka


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

Reply via email to