#ifndef _DRIVER_MANAGER_H_
#define _DRIVER_MANAGER_H_


#include "cppdbc_public_interface.h"
#include "grts/structs.db.mgmt.h"
#include <cppconn/driver.h>
#include <memory>


namespace sql
{


class CPPDBC_PUBLIC_FUNC DriverManager
{
  std::string _driver_path;
  std::list<Driver *> _drivers;

public:
  // Returns the DriverManager singleton
  static DriverManager *getDriverManager();

  DriverManager();

  // Sets the path to the directory where drivers are located
  void set_driver_dir(const std::string &path);

  // Returns a Connection object for the give connection params
  std::auto_ptr<Connection> getConnection(const db_mgmt_ConnectionRef &connectionProperties);

  // Returns the list of available drivers
  std::list<Driver *> getDrivers();
};


} // namespace sql


#endif // _DRIVER_MANAGER_H_
