All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.endoscope.storage.jdbc.DataSourceHelper Maven / Gradle / Ivy

There is a newer version: 1.0.9
Show newest version
package com.github.endoscope.storage.jdbc;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;

public class DataSourceHelper {
    public static DataSource findDatasource(String dsJndiPath) {
        try{
            Context initContext = new InitialContext();
            DataSource ds = (DataSource)initContext.lookup(dsJndiPath);
            return ds;
        }catch(NamingException e){
            throw new RuntimeException(e);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy