// Path: src/main/java/com/webpagebytes/wpbsample/utility/SampleConfigurator.java
// public class SampleConfigurator {
// 
// 	private Properties properties;
// 	private static SampleConfigurator instance;
// 	
// 	private SampleConfigurator() {};
// 	
// 	public static void initialize(String configPath) throws IOException
// 	{
// 		Properties properties = new Properties();
// 		properties.load(new FileInputStream(configPath));
// 		SampleConfigurator instance = new SampleConfigurator();
// 		instance.properties = properties;
// 		SampleConfigurator.instance = instance;
// 	}
// 	public static SampleConfigurator getInstance()
// 	{
// 		return instance;
// 	}
// 	public String getConfig(String key)
// 	{
// 		if (properties.containsKey(key))
// 			return properties.get(key).toString();
// 		else
// 			return "";
// 	}
// 
// }


import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.webpagebytes.wpbsample.utility.SampleConfigurator;

/*
 *   Copyright 2015 Webpagebytes
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
*/

package com.webpagebytes.wpbsample.database;



public class WPBDatabaseService {
	private static final Logger log = Logger.getLogger(WPBDatabaseService.class.getName());
	
	public static final String DB_PROPS_CONNECTION_URL = "db_connectionUrl";
	public static final String DB_PROPS_DRIVER_CLASS = "db_driverClass";
	public static final String DB_PROPS_USER_NAME = "db_userName";
	public static final String DB_PROPS_PASSWORD = "db_password";
	public static final String DB_PROPS_TEST_ON_BORROW = "db_testOnBorrow";
	public static final String DB_PROPS_VALIDATION_QUERY = "db_validationQuery";
    
	
	private static WPBDatabase database;
	private static final Object lock = new Object(); 
	public static WPBDatabase getInstance()
	{
		if (database == null)
		{
			synchronized (lock)
			{
				if (database == null) {

// Path: src/main/java/com/webpagebytes/wpbsample/utility/SampleConfigurator.java
// public class SampleConfigurator {
// 
// 	private Properties properties;
// 	private static SampleConfigurator instance;
// 	
// 	private SampleConfigurator() {};
// 	
// 	public static void initialize(String configPath) throws IOException
// 	{
// 		Properties properties = new Properties();
// 		properties.load(new FileInputStream(configPath));
// 		SampleConfigurator instance = new SampleConfigurator();
// 		instance.properties = properties;
// 		SampleConfigurator.instance = instance;
// 	}
// 	public static SampleConfigurator getInstance()
// 	{
// 		return instance;
// 	}
// 	public String getConfig(String key)
// 	{
// 		if (properties.containsKey(key))
// 			return properties.get(key).toString();
// 		else
// 			return "";
// 	}
// 
// }


// Path: src/main/java/com/webpagebytes/wpbsample/database/WPBDatabaseService.java
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.webpagebytes.wpbsample.utility.SampleConfigurator;

/*
 *   Copyright 2015 Webpagebytes
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
*/

package com.webpagebytes.wpbsample.database;



public class WPBDatabaseService {
	private static final Logger log = Logger.getLogger(WPBDatabaseService.class.getName());
	
	public static final String DB_PROPS_CONNECTION_URL = "db_connectionUrl";
	public static final String DB_PROPS_DRIVER_CLASS = "db_driverClass";
	public static final String DB_PROPS_USER_NAME = "db_userName";
	public static final String DB_PROPS_PASSWORD = "db_password";
	public static final String DB_PROPS_TEST_ON_BORROW = "db_testOnBorrow";
	public static final String DB_PROPS_VALIDATION_QUERY = "db_validationQuery";
    
	
	private static WPBDatabase database;
	private static final Object lock = new Object(); 
	public static WPBDatabase getInstance()
	{
		if (database == null)
		{
			synchronized (lock)
			{
				if (database == null) {

					SampleConfigurator configurator = SampleConfigurator.getInstance();
