struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Van Wart <sc...@indosoft.com>
Subject Re: [JAVA]How to get datatbase connection from lookup to datatsource name in a standalone java application
Date Thu, 24 Aug 2006 21:48:09 GMT
Caroline Jen wrote:
> Context ctx = new InitialContect();
> DataSource ds =
> (DataSource)ctx.lookup("java:com/env/jdbc/DBName");
> Connection con = ds.getConnection();
>   
Right, but that's assuming it's already bound, which is the hard part, 
and unless he's running it under OC4J, no such luck...

- Scott

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message