This was as suggsetion from Christian Rechner. 
I think it's should be used the opposite way: You put a datasource in the
ServletContext elsewhere, e.g. in struts. In dbforms you can then reuse this
datasource with the contextDataSource attribute.  
But if i looked into the sources there is missing something. The attribute
is in the DbConnection class but never used.

We should fix this.

Cheers,
Henner


> 
> I saw in the 2,4 release notes:
> 
> With the contextDataSource attribute you can use existing 
> DataSource-Object fromservlet-context-scope (e.g. from 
> struts-config.xml):  
> you just have to add a "contextDataSource" property to 
> dbforms-config.xml with the name of the scoped-Variable.
> 
> So would this be it
> 
>   <dbconnection
>            contextDataSource="lds"
>            id="non-jndi_local"
>               name   =  
> "jdbc:mysql://localhost:3306/FluencyBuilder?useUnicode=true&am
p;characterEncoding=Shift_JIS"
>               isJndi = "false"
>               conClass  = "org.gjt.mm.mysql.Driver"
>               username = "xx"
>               password  = "xx"
>       />
> 
> Then in code...
> 
> DataSource local_ds = (DataSource)
> config.getServletContext().getAttribute("lds");
> 
> I tried that from an interceptor but couldn't get it to work 
> (of course    
> local_con = config.getConnection("non-jndi_local"); is what I 
> really use in an interceptor but just wanted to tryit.
> 
> Let me know what works and I'll update the section on 
> multiple database connections.
> --
> Shawn
> 
> Karma is immutable, so act accordingly!
>  
> 
> 
> -------------------------------------------------------
> This SF.Net email sponsored by Black Hat Briefings & Training.
> Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
> digital self defense, top technical experts, no vendor 
> pitches, unmatched networking opportunities. Visit 
> www.blackhat.com _______________________________________________
> DbForms Mailing List
> 
> http://www.wap-force.net/dbforms
> 



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
DbForms Mailing List

http://www.wap-force.net/dbforms

Reply via email to