Here you can find the source of initializeDataSource()
public static void initializeDataSource() throws NamingException
//package com.java2s; //License from project: Apache License import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.sql.DataSource; public class Main { private static volatile DataSource ussdDatasource = null; public static void initializeDataSource() throws NamingException { if (ussdDatasource != null) { return; }// w ww . j a v a2 s . c om String statdataSourceName = "jdbc/CONNECT_DB"; if (statdataSourceName != null) { try { Context ctx = new InitialContext(); ussdDatasource = (DataSource) ctx.lookup(statdataSourceName); } catch (NamingException e) { //log.error(e); throw e; } } } }