org.histpop.server.db
Class SQLRepository
java.lang.Object
org.histpop.server.db.SQLRepository
- All Implemented Interfaces:
- Repository
public class SQLRepository
- extends java.lang.Object
- implements Repository
Constructor Summary |
SQLRepository(java.lang.String databaseURL,
java.lang.String databaseDriver)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SQLRepository
public SQLRepository(java.lang.String databaseURL,
java.lang.String databaseDriver)
throws ServerException
- Throws:
ServerException
load
public void load(PersistentObject obj)
throws ServerException
- Specified by:
load
in interface Repository
- Throws:
ServerException
save
public void save(PersistentObject obj)
throws ServerException
- Specified by:
save
in interface Repository
- Throws:
ServerException
insert
public void insert(PersistentObject obj)
throws ServerException
- Specified by:
insert
in interface Repository
- Throws:
ServerException
delete
public void delete(PersistentObject obj)
throws ServerException
- Specified by:
delete
in interface Repository
- Throws:
ServerException
list
public java.util.Vector list(java.lang.String type)
throws ServerException
- Specified by:
list
in interface Repository
- Throws:
ServerException
search
public java.util.Vector search(Query query)
throws ServerException
- Specified by:
search
in interface Repository
- Throws:
ServerException
filter
public java.util.Vector filter(java.lang.String type,
java.lang.String filter)
throws ServerException
- Specified by:
filter
in interface Repository
- Throws:
ServerException
RStoVector
public static java.util.Vector RStoVector(java.sql.ResultSet rs,
java.lang.String type)
throws java.sql.SQLException,
ServerException
- Throws:
java.sql.SQLException
ServerException
getTable
public Table getTable(java.lang.String type)
throws ServerException
- This methods returns the Table object for the given type
- Throws:
ServerException
addTable
public void addTable(java.lang.String tableName,
java.lang.String nickName,
java.lang.String sortfield,
java.lang.String[] primaryKey)
throws ServerException
- This method creates a new Table object based on a database table tableName,
and registers it
- Throws:
ServerException
getFields
public java.util.Vector getFields(java.lang.String tableName)
throws ServerException
- Throws:
ServerException
connectionIsClosed
public boolean connectionIsClosed()
getNewConnection
protected java.sql.Connection getNewConnection()
getConnection
protected java.sql.Connection getConnection()
openConnection
public void openConnection()
throws ServerException
- Throws:
ServerException
closeConnection
public void closeConnection()
prepareStatement
protected java.sql.PreparedStatement prepareStatement(java.lang.String query)
throws java.sql.SQLException
- Throws:
java.sql.SQLException