File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
REST with Spring (video course)
this week in the
how to use the datasource that has been set in tomcat
Joined: Sep 14, 2006
Sep 28, 2006 08:29:00
i know how to set Datasource in
, but i dont know how to use that Datasource name in our program. so,i kindly request you to please give solution for this problem
thanks and regards
Joined: Sep 06, 2003
Sep 29, 2006 06:49:00
The steps are as below (Note that you have to get two types of Context).
Context initContext = new InitialContext(); Context envContext = (Context)initContext.lookup("java:/comp/env"); DataSource ds = (DataSource) envContext.lookup("jdbc/MyApplicationDSName"); Connection conn=ds.getConnection();
I agree. Here's the link:
subject: how to use the datasource that has been set in tomcat
Servlet action is not available
datasource on tomcat 6
How to integrate SQL server with JBOSS
How to set up DataSource in plain Java application?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015