[jboss-user] [Beginners Corner] - Re: example application for jdbc

jaikiran do-not-reply at jboss.com
Mon Oct 8 03:48:36 EDT 2007


For configuring a datasource, you just need a *-ds.xml file which needs to be placed in the server/< serverName>/deploy folder. For more details about how to configure a datasource, have a look at http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfigDataSources. That wiki article also has specific examples for different databases. Once you have successfully deployed the datasource, in order to use this datasource, you will have to do a JNDI lookup in your code as follows:

  | Context ctx = new InitialContext();
  | Datasource ds = (Datasource) ctx.lookup("java:/TheJNDINameThatYouSpecifiedForYourDatasource");

anonymous wrote : calling that data source from a stand alone program. 

Have a look at http://wiki.jboss.org/wiki/Wiki.jsp?page=HowCanIAccessADataSourceFromAClient

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4092420#4092420

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4092420



More information about the jboss-user mailing list