|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jcrontab.data.GenericSQLSource
This class is only a generic example and doesn't aim to solve all the needs for the differents system's. if you want to make this class to fit your needs feel free to do it and remember the license. On of the things this class does is to open a connection to the database , this is nasty and very expensive, y you want to integrate jcrontab with a pool like poolman or jboss it's quite easy, should substitute connection logic with particular one.
Field Summary | |
static java.lang.String |
queryAll
This Query gets all the Crontab entries from the events table |
static java.lang.String |
queryRemoving
This Query removes the given Crontab Entries |
static java.lang.String |
querySearching
This Query gets all the Crontab entries from the events table but searching by the name |
static java.lang.String |
queryStoring
This Query stores the Crontab entries |
Constructor Summary | |
protected |
GenericSQLSource()
Creates new GenericSQLSource |
Method Summary | |
CrontabEntryBean |
find(CrontabEntryBean ceb)
This method searches the Crontab Entry that the class has the given name |
CrontabEntryBean[] |
findAll()
This method searches all the CrontabEntries from the DataSource |
protected java.sql.Connection |
getConnection()
Retrieves a connection to the database. |
DataSource |
getInstance()
This method grants this class to be a singleton and grants data access integrity |
protected java.lang.Object |
loadDatabaseDriver(java.lang.String srcName)
Initializes the database engine/data source. |
void |
remove(CrontabEntryBean[] beans)
This method removes the given Crontab Entries |
void |
store(CrontabEntryBean bean)
This method saves the CrontabEntryBean the actual problem with this method is that doesn´t store comments and blank lines from the original file any ideas? |
void |
store(CrontabEntryBean[] beans)
This method saves the CrontabEntryBean the actual problem with this method is that doesn´t store comments and blank lines from the original file any ideas? |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static java.lang.String queryAll
public static java.lang.String querySearching
public static java.lang.String queryStoring
public static java.lang.String queryRemoving
Constructor Detail |
protected GenericSQLSource()
Method Detail |
public DataSource getInstance()
getInstance
in interface DataSource
public CrontabEntryBean find(CrontabEntryBean ceb) throws CrontabEntryException, java.lang.ClassNotFoundException, java.sql.SQLException, DataNotFoundException
find
in interface DataSource
CrontabEntryException
- when it can't parse the line correctly
java.lang.ClassNotFoundException
- cause loading the driver can throw an
ClassNotFoundException
java.sql.SQLException
- Yep can throw an SQLException too
DataNotFoundException
public CrontabEntryBean[] findAll() throws CrontabEntryException, java.lang.ClassNotFoundException, java.sql.SQLException, DataNotFoundException
findAll
in interface DataSource
CrontabEntryException
- when it can't parse the line correctly
java.lang.ClassNotFoundException
- cause loading the driver can throw an
ClassNotFoundException
java.sql.SQLException
- Yep can throw an SQLException too
DataNotFoundException
public void remove(CrontabEntryBean[] beans) throws CrontabEntryException, java.lang.ClassNotFoundException, java.sql.SQLException
remove
in interface DataSource
CrontabEntryException
- when it can't parse the line correctly
java.lang.ClassNotFoundException
- cause loading the driver can throw an
ClassNotFoundException
java.sql.SQLException
- Yep can throw an SQLException toopublic void store(CrontabEntryBean[] beans) throws CrontabEntryException, java.lang.ClassNotFoundException, java.sql.SQLException
store
in interface DataSource
CrontabEntryException
- when it can't parse the line correctly
java.lang.ClassNotFoundException
- cause loading the driver can throw an
ClassNotFoundException
java.sql.SQLException
- Yep can throw an SQLException toopublic void store(CrontabEntryBean bean) throws CrontabEntryException, java.lang.ClassNotFoundException, java.sql.SQLException
store
in interface DataSource
CrontabEntryException
- when it can't parse the line correctly
java.lang.ClassNotFoundException
- cause loading the driver can throw an
ClassNotFoundException
java.sql.SQLException
- Yep can throw an SQLException tooprotected java.sql.Connection getConnection() throws java.sql.SQLException
Connection
java.sql.SQLException
- if there is an error retrieving the Connection.protected java.lang.Object loadDatabaseDriver(java.lang.String srcName) throws java.sql.SQLException
srcName
- is the JDBC DataSource name or null to load the driver.
SQLExcption
- if there is no valid driver.
java.sql.SQLException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |