package rbsla.utils.contractQsc;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

import rbsla.environment.ECAConstraints;

public class DBManager 
{

	private Connection db;
	
	public DBManager()
	{
		try
		{
			Class.forName(ECAConstraints._DB_DRIVER);
			Connection con = DriverManager.getConnection(ECAConstraints._DB_NAME, ECAConstraints._DB_USER, ECAConstraints._DB_PWD);
			db = con;
		}
		catch(Exception ex)
		{
			ex.printStackTrace();
		}
	}
	
	/**
	 * 
	 * @param time
	 * @param server
	 * @param status
	 */
	public Boolean storeAvailability(String time, String server, Object status)
	{
		System.out.println("hier zeit" + time);
		return Boolean.TRUE;
		/**
		try
		{
			Statement st = db.createStatement();
			String query = "INSERT INTO availability VALUES[";
			st.executeUpdate(query);
			
		}
		catch(Exception ex)
		{
			ex.printStackTrace();
		} **/
	}
	
	public Boolean test()
	{
		System.out.println("hiertest");
		return Boolean.TRUE;
	}

}
