com.flickrrecsys.db
Class DbTag

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

public class DbTag
extends java.lang.Object

Connecting to tag table

Author:
Hossein Ghodsi

Constructor Summary
DbTag(java.lang.String path)
          Constructor which gets the connection to the database
 
Method Summary
 boolean alreadyExist(java.lang.String text)
          Check if the tag already exists
 int insert(java.lang.String text)
          Insert group
 int tagID(java.lang.String tag)
          Get tag id
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbTag

public DbTag(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 text)
           throws java.sql.SQLException,
                  java.security.NoSuchAlgorithmException,
                  java.io.UnsupportedEncodingException
Insert group

Parameters:
text - group name
Returns:
row affected in the tag table
Throws:
java.sql.SQLException
java.security.NoSuchAlgorithmException
java.io.UnsupportedEncodingException

alreadyExist

public boolean alreadyExist(java.lang.String text)
                     throws java.sql.SQLException
Check if the tag already exists

Parameters:
text - name of group
Returns:
true / false
Throws:
java.sql.SQLException

tagID

public int tagID(java.lang.String tag)
          throws java.sql.SQLException
Get tag id

Parameters:
tag - tag name
Returns:
tag id
Throws:
java.sql.SQLException