tico.imageGallery.dataBase
Class TIGDataBase

java.lang.Object
  extended by tico.imageGallery.dataBase.TIGDataBase

public class TIGDataBase
extends java.lang.Object

Database for the images in the gallery.

Version:
1.0 Jan 18, 2008
Author:
Patricia M. Jaray

Constructor Summary
TIGDataBase()
           
 
Method Summary
static void activateTransactions()
          Activate transactions.
static boolean areAsociated(int concept, int image)
          Are asociated.
static java.util.Vector<java.lang.String> asociatedConceptSearch(java.lang.String path)
          Asociated concept search.
static void closeDB()
          Close the connection to the database.
static int conceptKeySearch(java.lang.String concept)
          Concept key search.
static void conectDB()
          Connect to database.
static void createTablesDB()
          Create the tables Image, Concept and Asociated in the database.
static int deleteAsociatedDB(int concept, int image)
          Delete the association between the concept with the id indicate by concept and the image with the id indicate by image.
static int deleteAsociatedOfImage(int image)
          Delete all the associations of the image with the id indicate by image.
static int deleteConceptDB(java.lang.String concept)
          Delete concept database.
static int deleteImageDB(int key)
          Delete image database.
static void executeQueries()
          Execute queries.
static java.util.Vector<java.lang.String> getKeyWords()
          Gets the key words.
static int imageKeySearch(java.lang.String imagen)
          Image key search.
static int imageKeySearchName(java.lang.String imagen)
          Image key search name.
static java.lang.String imageNameSearch(java.lang.String path)
          Image name search.
static java.util.Vector<java.util.Vector<java.lang.String>> imageSearchByKeyWords(java.lang.String keyWord1, int searchOptions1, java.lang.String keyWord2, int searchOptions2, java.lang.String keyWord3)
          Search.
static java.util.Vector<java.util.Vector<java.lang.String>> imageSearchByName(java.lang.String imagen)
          Image search.
static void insertAsociatedDB(int concept, int image)
          Insert asociated database.
static int insertConceptDB(java.lang.String concept)
          Insert concept in the table Concept of database.
static void insertDB(java.util.Vector concepts, java.lang.String imagePath, java.lang.String imageName)
          Insert database.
static void insertImageDB(java.lang.String name, java.lang.String path)
          Insert image database.
static int modifyImage(java.lang.String path, java.util.Vector concepts)
          Modify image.
static int updateConceptDB(java.lang.String oldConcept, java.lang.String newConcept)
          Update concept database.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TIGDataBase

public TIGDataBase()
Method Detail

conectDB

public static void conectDB()
Connect to database.


closeDB

public static void closeDB()
Close the connection to the database.


createTablesDB

public static void createTablesDB()
Create the tables Image, Concept and Asociated in the database.


insertConceptDB

public static int insertConceptDB(java.lang.String concept)
Insert concept in the table Concept of database.

Parameters:
concept - the concept
Returns:
the int

updateConceptDB

public static int updateConceptDB(java.lang.String oldConcept,
                                  java.lang.String newConcept)
Update concept database.

Parameters:
oldConcept - the old concept
newConcept - the new concept
Returns:
the int

deleteAsociatedOfImage

public static int deleteAsociatedOfImage(int image)
Delete all the associations of the image with the id indicate by image.

Parameters:
image - the image
Returns:
the int

activateTransactions

public static void activateTransactions()
Activate transactions.


executeQueries

public static void executeQueries()
Execute queries.


deleteImageDB

public static int deleteImageDB(int key)
Delete image database.

Parameters:
key - the key
Returns:
the int

deleteConceptDB

public static int deleteConceptDB(java.lang.String concept)
Delete concept database.

Parameters:
concept - the concept
Returns:
the int

insertImageDB

public static void insertImageDB(java.lang.String name,
                                 java.lang.String path)
Insert image database.

Parameters:
name - the name
path - the path

insertAsociatedDB

public static void insertAsociatedDB(int concept,
                                     int image)
Insert asociated database.

Parameters:
concept - the concept
image - the image

insertDB

public static void insertDB(java.util.Vector concepts,
                            java.lang.String imagePath,
                            java.lang.String imageName)
Insert database.

Parameters:
concepts - the concepts
imagePath - the image path
imageName - the image name

getKeyWords

public static java.util.Vector<java.lang.String> getKeyWords()
Gets the key words.

Returns:
the key words

imageNameSearch

public static java.lang.String imageNameSearch(java.lang.String path)
Image name search.

Parameters:
path - the path
Returns:
the string

imageSearchByName

public static java.util.Vector<java.util.Vector<java.lang.String>> imageSearchByName(java.lang.String imagen)
Image search.

Parameters:
imagen - the imagen
Returns:
the vector

imageKeySearch

public static int imageKeySearch(java.lang.String imagen)
Image key search.

Parameters:
imagen - the imagen
Returns:
the int

imageKeySearchName

public static int imageKeySearchName(java.lang.String imagen)
Image key search name.

Parameters:
imagen - the imagen
Returns:
the int

conceptKeySearch

public static int conceptKeySearch(java.lang.String concept)
Concept key search.

Parameters:
concept - the concept
Returns:
the int

asociatedConceptSearch

public static java.util.Vector<java.lang.String> asociatedConceptSearch(java.lang.String path)
Asociated concept search.

Parameters:
path - the path
Returns:
the vector< string>

deleteAsociatedDB

public static int deleteAsociatedDB(int concept,
                                    int image)
Delete the association between the concept with the id indicate by concept and the image with the id indicate by image.

Parameters:
concept - the concept
image - the image
Returns:
the int

modifyImage

public static int modifyImage(java.lang.String path,
                              java.util.Vector concepts)
Modify image.

Parameters:
path - the path
concepts - the concepts
Returns:
the int

areAsociated

public static boolean areAsociated(int concept,
                                   int image)
Are asociated.

Parameters:
concept - the concept
image - the image
Returns:
true, if successful

imageSearchByKeyWords

public static java.util.Vector<java.util.Vector<java.lang.String>> imageSearchByKeyWords(java.lang.String keyWord1,
                                                                                         int searchOptions1,
                                                                                         java.lang.String keyWord2,
                                                                                         int searchOptions2,
                                                                                         java.lang.String keyWord3)
Search.

Parameters:
keyWord1 - the key word1
searchOptions1 - the search options1
keyWord2 - the key word2
searchOptions2 - the search options2
keyWord3 - the key word3
Returns:
the vector