Protege-2000 1.7

edu.stanford.smi.protege.storage.jdbc
Class SimpleJdbcDatabaseManager

java.lang.Object
  |
  +--edu.stanford.smi.protege.storage.jdbc.SimpleJdbcDatabaseManager
All Implemented Interfaces:
DatabaseConstants, DatabaseManager, Disposable

public class SimpleJdbcDatabaseManager
extends Object
implements DatabaseManager


Inner Class Summary
static class SimpleJdbcDatabaseManager.ValueDBIndexPair
           
 
Fields inherited from interface edu.stanford.smi.protege.storage.jdbc.DatabaseConstants
TYPE_BOOLEAN, TYPE_CLASS, TYPE_FACET, TYPE_FLOAT, TYPE_INTEGER, TYPE_INVALID, TYPE_SIMPLE_INSTANCE, TYPE_SLOT, TYPE_STRING
 
Constructor Summary
SimpleJdbcDatabaseManager(String driver, String url, String tablename, String username, String password, Collection errors)
           
 
Method Summary
 void addValue(Frame frame, Slot slot, Facet facet, boolean isTemplate, Object value)
           
 boolean beginTransaction()
          returns true if transaction started successfully
 void createIndexes()
           
 void createTable()
           
 void dispose()
           
 boolean endTransaction(boolean doCommit)
          return true if transation commited successfull
 Collection getAllFrameIDs()
           
 Collection getDBReferences(Object o, int maxMatches)
          returns a collection of DBReference objects
 String getDriverLongvarcharName()
           
 String getDriverName()
           
 int getFrameCount(int type)
           
 FrameIDAllocator getFrameIDAllocator()
           
 Collection getFrameIDs(FrameID slot, FrameID facet, boolean isTemplate, String value)
           
 Collection getFramesWithValue(Slot slot, Facet facet, boolean isTemplate)
          returns a collection of Objects.
 int getFrameType(FrameID id)
           
 String getLongvarcharName()
           
 Collection getMatchingFrameIDs(FrameID slot, FrameID facet, boolean isTemplate, String value, int maxMatches)
           
 String getParameterLongvarcharName()
           
 String getTableName()
           
 int getValueCount(FrameID frame, FrameID slot, FrameID facet, boolean isTemplate)
           
 List getValues(FrameID frame, FrameID slot, FrameID facet, boolean isTemplate)
          returns a collection of Objects.
 boolean hasValueAtSomeFrame(Slot slot, Facet facet, boolean isTemplate)
           
 void initializeLongStringWorkingFlag()
           
 void initializeNeedsUpper()
           
static void main(String[] args)
           
 void removeAllReferences(Frame frame)
           
 void removeAllValues(Frame frame, Slot slot, Facet facet, boolean isTemplate)
           
 void removeFramesWithValue(Slot slot, Facet facet, boolean isTemplate)
           
 void removeSingleValue(Frame frame, Slot slot, Facet facet, boolean isTemplate, Object value)
           
 void removeValues(FrameID slot)
           
 void saveKnowledgeBase(KnowledgeBase kb)
           
 void setTracing(boolean b)
           
 void setValue(Frame frame, Slot slot, Facet facet, boolean isTemplate, Object value)
           
 void setValues(Frame frame, Slot slot, Facet facet, boolean isTemplate, Collection values)
           
 boolean supportsTransactions()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleJdbcDatabaseManager

public SimpleJdbcDatabaseManager(String driver,
                                 String url,
                                 String tablename,
                                 String username,
                                 String password,
                                 Collection errors)
Method Detail

addValue

public void addValue(Frame frame,
                     Slot slot,
                     Facet facet,
                     boolean isTemplate,
                     Object value)
              throws SQLException
Specified by:
addValue in interface DatabaseManager

beginTransaction

public boolean beginTransaction()
returns true if transaction started successfully
Specified by:
beginTransaction in interface DatabaseManager

createIndexes

public void createIndexes()
                   throws SQLException

createTable

public void createTable()
                 throws SQLException

dispose

public void dispose()
Specified by:
dispose in interface Disposable

endTransaction

public boolean endTransaction(boolean doCommit)
return true if transation commited successfull
Specified by:
endTransaction in interface DatabaseManager

getFrameCount

public int getFrameCount(int type)
                  throws SQLException
Specified by:
getFrameCount in interface DatabaseManager

getAllFrameIDs

public Collection getAllFrameIDs()
                          throws SQLException
Specified by:
getAllFrameIDs in interface DatabaseManager

getDBReferences

public Collection getDBReferences(Object o,
                                  int maxMatches)
                           throws SQLException
Description copied from interface: DatabaseManager
returns a collection of DBReference objects
Specified by:
getDBReferences in interface DatabaseManager
Following copied from interface: edu.stanford.smi.protege.storage.jdbc.DatabaseManager
Parameters:
o - Description of Parameter
Returns:
The DBReferences value
Throws:
SQLException - Description of Exception

getDriverLongvarcharName

public String getDriverLongvarcharName()
                                throws SQLException

getDriverName

public String getDriverName()
Specified by:
getDriverName in interface DatabaseManager

getFrameIDAllocator

public FrameIDAllocator getFrameIDAllocator()

getFrameIDs

public Collection getFrameIDs(FrameID slot,
                              FrameID facet,
                              boolean isTemplate,
                              String value)
                       throws SQLException
Specified by:
getFrameIDs in interface DatabaseManager

getFramesWithValue

public Collection getFramesWithValue(Slot slot,
                                     Facet facet,
                                     boolean isTemplate)
                              throws SQLException
Description copied from interface: DatabaseManager
returns a collection of Objects. A frame is returned as a frameID
Specified by:
getFramesWithValue in interface DatabaseManager

getFrameType

public int getFrameType(FrameID id)
                 throws SQLException
Specified by:
getFrameType in interface DatabaseManager

getLongvarcharName

public String getLongvarcharName()
                          throws SQLException

getMatchingFrameIDs

public Collection getMatchingFrameIDs(FrameID slot,
                                      FrameID facet,
                                      boolean isTemplate,
                                      String value,
                                      int maxMatches)
                               throws SQLException
Specified by:
getMatchingFrameIDs in interface DatabaseManager

getParameterLongvarcharName

public String getParameterLongvarcharName()

getTableName

public String getTableName()
Specified by:
getTableName in interface DatabaseManager

getValueCount

public int getValueCount(FrameID frame,
                         FrameID slot,
                         FrameID facet,
                         boolean isTemplate)
                  throws SQLException
Specified by:
getValueCount in interface DatabaseManager

getValues

public List getValues(FrameID frame,
                      FrameID slot,
                      FrameID facet,
                      boolean isTemplate)
               throws SQLException
Description copied from interface: DatabaseManager
returns a collection of Objects. A frame is returned as a frameID
Specified by:
getValues in interface DatabaseManager

hasValueAtSomeFrame

public boolean hasValueAtSomeFrame(Slot slot,
                                   Facet facet,
                                   boolean isTemplate)
                            throws SQLException
Specified by:
hasValueAtSomeFrame in interface DatabaseManager

initializeLongStringWorkingFlag

public void initializeLongStringWorkingFlag()
                                     throws SQLException

initializeNeedsUpper

public void initializeNeedsUpper()
                          throws SQLException

main

public static void main(String[] args)

removeAllReferences

public void removeAllReferences(Frame frame)
                         throws SQLException
Specified by:
removeAllReferences in interface DatabaseManager

removeAllValues

public void removeAllValues(Frame frame,
                            Slot slot,
                            Facet facet,
                            boolean isTemplate)
                     throws SQLException
Specified by:
removeAllValues in interface DatabaseManager

removeFramesWithValue

public void removeFramesWithValue(Slot slot,
                                  Facet facet,
                                  boolean isTemplate)
                           throws SQLException
Specified by:
removeFramesWithValue in interface DatabaseManager

removeSingleValue

public void removeSingleValue(Frame frame,
                              Slot slot,
                              Facet facet,
                              boolean isTemplate,
                              Object value)
                       throws SQLException
Specified by:
removeSingleValue in interface DatabaseManager

removeValues

public void removeValues(FrameID slot)
                  throws SQLException

saveKnowledgeBase

public void saveKnowledgeBase(KnowledgeBase kb)
                       throws SQLException
Specified by:
saveKnowledgeBase in interface DatabaseManager

setTracing

public void setTracing(boolean b)
Specified by:
setTracing in interface DatabaseManager

setValue

public void setValue(Frame frame,
                     Slot slot,
                     Facet facet,
                     boolean isTemplate,
                     Object value)
              throws SQLException
Specified by:
setValue in interface DatabaseManager

setValues

public void setValues(Frame frame,
                      Slot slot,
                      Facet facet,
                      boolean isTemplate,
                      Collection values)
               throws SQLException
Specified by:
setValues in interface DatabaseManager

supportsTransactions

public boolean supportsTransactions()
Specified by:
supportsTransactions in interface DatabaseManager

toString

public String toString()
Overrides:
toString in class Object

Protege-2000 1.7

Submit a bug report or feature request
Protege-2000 is a trademark of Stanford University.
Copyright (c) 1998-2002 Stanford University.