com.flickrrecsys.util
Class DbConnection

java.lang.Object
  extended by com.flickrrecsys.util.DbConnection

public class DbConnection
extends java.lang.Object

This class opens up connection to the database and uses a property file to extract details of the database including the database server, username, password, etc.

Author:
Hossein Ghodsi

Constructor Summary
DbConnection(java.lang.String connectionPath)
          Constructor
 
Method Summary
 void closeConnection()
          Close connection to the database
 java.util.Properties getConnectionProperty()
          Get connection properties from the given path
 java.sql.Connection openConnection()
          Open connection to the database - this method uses SQL driver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbConnection

public DbConnection(java.lang.String connectionPath)
Constructor

Parameters:
connectionPath - where the database connection details are
Method Detail

openConnection

public java.sql.Connection openConnection()
Open connection to the database - this method uses SQL driver

Returns:
open connection to the database

closeConnection

public void closeConnection()
Close connection to the database


getConnectionProperty

public java.util.Properties getConnectionProperty()
Get connection properties from the given path

Returns:
Properties