agentland.device.intelliCD
Class SQLProcessor
java.lang.Object
|
+--agentland.device.intelliCD.SQLProcessor
- Direct Known Subclasses:
- CDProcessor, LiquidAudioProcessor, SoftwareProcessor
- public abstract class SQLProcessor
- extends Object
The generic interface for loading the disc data from the database.
Constructor Summary |
SQLProcessor(Player p)
Creates the SQLProcessor, given an agent for handling requests. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
curLocation
protected String curLocation
SQLProcessor
public SQLProcessor(Player p)
- Creates the SQLProcessor, given an agent for handling requests.
The agent will be installed into the processed songs.
- Parameters:
p
- The agent used for playing songs This gets added to the
song.
getType
public abstract String getType()
- Fetches the type of data being accessed. This is used to get the
right information out of the database.
buildSong
public Song buildSong(ResultSet rs,
SongContainer sc)
throws SQLException
- Creates a song from a ResultSet. This should be used by
subclasses to make a song of the correct type. This method
should not modify the result set at all. It must only call
get...() methods to retrieve values. This method should add the
created song into the song container, through whatever method is
appropriate.
- Parameters:
rs
- A ResultSet holding a row of a song.sc
- The SongContainer to add this song into.- Returns:
- the song corresponding to the ResultSet.
buildContainer
public SongContainer buildContainer(ResultSet rs)
throws SQLException
containerQuery
protected String containerQuery(int coll_id)
songQuery
protected String songQuery(int coll_id)
process
public void process(Connection cnxn,
SCollection coll,
String where)
- Uses the given SQL Connection to retrieve any containers that are
desired, and will return them to the collection using any of a
number of SCollection methods. This simply runs queries on the
database, and adds song collections to the SCollection.
- Parameters:
cnxn
- the database connection to use.coll
- a SCollection
valuewhere
- table to use to find collections
process.- See Also:
SCollection
,
Connection
cleanContainer
public void cleanContainer(SongContainer c)
- Cleanup procedure to remove nulls from the collection.