|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jidesoft.rss.FeedDatabasePersistenceManager
public class FeedDatabasePersistenceManager
An implementation of FeedPersistenceLayer
using hsqldb (http://hsqldb.org/). By default, it will take a
local folder and create two subfolders. The "icon" subfolder is for channel icons. The "db" subfolder for hsqldb
file.
Constructor Summary | |
---|---|
FeedDatabasePersistenceManager(FeedReader feedReader)
|
Method Summary | |
---|---|
void |
addChannelToGroup(ChannelIF channel,
ChannelGroupIF group)
|
void |
close()
flush data, close the db. |
ChannelIF |
createChannel(String title,
URL url)
|
ChannelGroupIF |
createGroup(String title)
|
ItemIF |
createItem(ChannelIF channel,
ItemIF item)
|
ItemIF |
createItem(ChannelIF channel,
String itemTitle)
|
void |
deleteChannel(ChannelIF channel)
|
void |
deleteGroup(ChannelGroupIF group)
|
void |
deleteItem(ItemIF item)
|
protected Connection |
getConnection()
Gets the database connection. |
ChannelGroupIF[] |
getGroups()
|
protected URL |
getScriptURL()
Gets the URL for rssdbscript.dll. |
protected String |
getTableName(String originalTableName)
Gets the table name. |
protected String |
getTablePostfix()
Gets the table name postfix. |
protected String |
getTablePrefix()
Gets the table name prefix. |
protected boolean |
initializeDB()
Initializes the database. |
protected void |
installDB(Connection connection)
Installs the database. |
void |
mergeGroups(ChannelGroupIF dstGroup,
ChannelGroupIF srcGroup)
|
protected PreparedStatement |
prepareStatement(Connection connection,
String sql)
By default, this method will call connection.prepareStatement(sql) and return the returned value. |
void |
removeChannelFromGroup(ChannelIF channel,
ChannelGroupIF group)
|
void |
updateChannel(ChannelIF channel)
|
void |
updateGroup(ChannelGroupIF group)
|
void |
updateItem(ItemIF item)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FeedDatabasePersistenceManager(FeedReader feedReader)
Method Detail |
---|
public ChannelGroupIF createGroup(String title) throws PersistenceManagerException
PersistenceManagerException
public void updateGroup(ChannelGroupIF group) throws PersistenceManagerException
PersistenceManagerException
public void deleteGroup(ChannelGroupIF group) throws PersistenceManagerException
PersistenceManagerException
public void mergeGroups(ChannelGroupIF dstGroup, ChannelGroupIF srcGroup) throws PersistenceManagerException
PersistenceManagerException
public ChannelGroupIF[] getGroups() throws PersistenceManagerException
PersistenceManagerException
public ChannelIF createChannel(String title, URL url) throws PersistenceManagerException
PersistenceManagerException
public void updateChannel(ChannelIF channel) throws PersistenceManagerException
PersistenceManagerException
public void addChannelToGroup(ChannelIF channel, ChannelGroupIF group) throws PersistenceManagerException
PersistenceManagerException
public void removeChannelFromGroup(ChannelIF channel, ChannelGroupIF group) throws PersistenceManagerException
PersistenceManagerException
public void deleteChannel(ChannelIF channel) throws PersistenceManagerException
PersistenceManagerException
public ItemIF createItem(ChannelIF channel, String itemTitle) throws PersistenceManagerException
PersistenceManagerException
public ItemIF createItem(ChannelIF channel, ItemIF item) throws PersistenceManagerException
PersistenceManagerException
public void updateItem(ItemIF item) throws PersistenceManagerException
PersistenceManagerException
public void deleteItem(ItemIF item) throws PersistenceManagerException
PersistenceManagerException
public void close() throws Exception
Exception
- if any database access errors.protected boolean initializeDB() throws Exception
installDB(java.sql.Connection)
method.
Exception
- if any errors happen during the initialization such as the driver class not found or database
access problem.protected void installDB(Connection connection)
connection
- the connection.protected URL getScriptURL()
protected Connection getConnection()
protected String getTableName(String originalTableName)
getTablePrefix()
or getTablePostfix()
if you just want to add a prefix or postfix. However make
sure you change them in the rssdbscript.ddl file to match what you changed here.
originalTableName
- the original table name
protected String getTablePrefix()
getTableName(String)
method.
protected String getTablePostfix()
getTableName(String)
method.
protected PreparedStatement prepareStatement(Connection connection, String sql) throws SQLException
connection
- the connectionsql
- an SQL statement that may contain one or more '?' IN parameter placeholders
SQLException
- if a database access error occurs or this method is called on a closed connection
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |