com.flickrrecsys.db
Class DbGroup

java.lang.Object
  extended by com.flickrrecsys.db.DbGroup

public class DbGroup
extends java.lang.Object

Connecting to the group table in the database

Author:
Hossein Ghodsi

Constructor Summary
DbGroup(java.lang.String path)
          Constructor which gets the connection to the database
 
Method Summary
 boolean alreadyExist(java.lang.String groupId)
          Check if the group id already exist
 int getGId(java.lang.String groupId)
          Get local group id
 int insert(java.lang.String groupName, java.lang.String groupId)
          Insert group
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbGroup

public DbGroup(java.lang.String path)
Constructor which gets the connection to the database

Parameters:
path - to where the database details are
Method Detail

insert

public int insert(java.lang.String groupName,
                  java.lang.String groupId)
           throws java.sql.SQLException,
                  java.security.NoSuchAlgorithmException,
                  java.io.UnsupportedEncodingException
Insert group

Parameters:
groupName - name of group
groupId - group id from the flickr website
Returns:
row id
Throws:
java.sql.SQLException
java.security.NoSuchAlgorithmException
java.io.UnsupportedEncodingException

alreadyExist

public boolean alreadyExist(java.lang.String groupId)
                     throws java.sql.SQLException
Check if the group id already exist

Parameters:
groupId - group id from the flickr website
Returns:
true or flase
Throws:
java.sql.SQLException

getGId

public int getGId(java.lang.String groupId)
           throws java.sql.SQLException
Get local group id

Parameters:
groupId - group id from the flickr website
Returns:
local group id
Throws:
java.sql.SQLException