|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ap.jdbcunit.csv.CSVMedia
A CSV media is writing the tracks, the result sets, to distinct files and stores, at the same level, the TOC file. All the files (stores) are formatted using a comma separated values text format.
Constructor Summary | |
CSVMedia(Store repository)
Creates a CSVMedia that is writing the TOC, the repository, to the given store and the result sets are stored at the same level as the repository. |
Method Summary | |
void |
close()
Close the media, the media flushes everything that need to be saved to the persistent store. |
void |
closeTrack()
Close the current track |
int |
countTracks()
|
void |
delete()
Deletes everything that is related to this media |
void |
deleteTrack(java.lang.String dbURL,
java.lang.String sql)
Deletes the track identified by the given URL and SQL statement |
boolean |
existsTrack(java.lang.String dbURL,
java.lang.String sql)
Answers the question "Does this media contain some SQL statement?" |
void |
foreachTrack(MediaVisitor visitor)
Start visiting all the tracks contained in this media. |
java.util.Iterator |
getTrack(java.lang.String dbURL,
java.lang.String sql)
Return the track (the results) identified by the given URL and SQL statement |
void |
newTrack(java.lang.String dbURL,
java.lang.String sql,
java.util.List columnNames)
Adds a new track of result, the result was obtained by executing the given SQL statement on the database (identified by the URL). |
void |
open()
Open the media so that it can be used |
void |
write(java.util.List row)
Add a row to the current track. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CSVMedia(Store repository)
repository
- the Store that contains the TOCMethod Detail |
public void open()
Media
open
in interface Media
public void close()
Media
close
in interface Media
public void delete()
Media
delete
in interface Media
public int countTracks()
countTracks
in interface Media
public void foreachTrack(MediaVisitor visitor)
Media
foreachTrack
in interface Media
visitor
- the MediaVisitor object interrested in handling all the
tracks contained in this mediapublic boolean existsTrack(java.lang.String dbURL, java.lang.String sql)
Media
existsTrack
in interface Media
dbURL
- the database URL as Stringsql
- the SQL statement as String
public void newTrack(java.lang.String dbURL, java.lang.String sql, java.util.List columnNames)
Media
newTrack
in interface Media
dbURL
- the database that returned some resultsql
- the executed SQL statementcolumnNames
- the list of all the columnsMedia.write
public void closeTrack()
Media
closeTrack
in interface Media
public void write(java.util.List row)
Media
write
in interface Media
row
- a list of values (the size of the list should be thes
as the current track's number of columns.public java.util.Iterator getTrack(java.lang.String dbURL, java.lang.String sql)
Media
getTrack
in interface Media
dbURL
- the database URLsql
- the SQL statement
public void deleteTrack(java.lang.String dbURL, java.lang.String sql)
Media
deleteTrack
in interface Media
dbURL
- the database URLsql
- the SQL statement
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |