Return to Snippet

Revision: 4676
at January 15, 2008 08:50 by narkisr


Updated Code
InitialContext ictx = null;
   try {
      ictx = new InitialContext();
      final DataSource dataSource = (DataSource)ictx.lookup("java:/DefaultDS");
      final JdbcTemplate template = new JdbcTemplate(dataSource);
      // do your work here
   } catch (Exception e) {
    log.error("..");
   }

Revision: 4675
at January 15, 2008 08:49 by narkisr


Updated Code
InitialContext ictx = null;
   try {
      ictx = new InitialContext();
      final DataSource dataSource = (DataSource)ictx.lookup("java:/DefaultDS");
      final JdbcTemplate template = new JdbcTemplate(dataSource);
      // do your work here
   } catch (Exception e) {
    log.error("..");
  }

Revision: 4674
at January 15, 2008 08:48 by narkisr


Updated Code
InitialContext ictx = null;
   try {
      ictx = new InitialContext();
     final DataSource dataSource = (DataSource)ictx.lookup("java:/DefaultDS");
    final JdbcTemplate template = new JdbcTemplate(dataSource);
// do your work here
		} catch (Exception e) {
			log.error("..");
		}

Revision: 4673
at January 15, 2008 08:47 by narkisr


Initial Code
InitialContext ictx = null;
   try {
      ictx = new InitialContext();
    final DataSource dataSource = (DataSource) ictx.lookup("java:/DefaultDS");
 final JdbcTemplate template = new JdbcTemplate(dataSource);
// do your work here
		} catch (Exception e) {
			log.error("..");
		}

Initial URL

                                

Initial Description
This is a simple lookup and usage of the default DS in JBoss

Initial Title
JBoss Default DS usage

Initial Tags
java

Initial Language
Java