protected class CsvWriter.Instance extends Object
Methods and properties in this class will normally not be overridden.
Modifier and Type | Field and Description |
---|---|
protected int |
columnCount
Number of columns in result set
|
protected DatabaseProperties |
data
Object containing database connection information.
|
protected String |
message
String to be placed in CSV file as the first line in the file.
|
protected PrintWriter |
output
Object representing the output to the HTTP response.
|
protected String |
outputFilename
File name to be used when creating file.
|
protected HttpServletRequest |
request
Object containing HTTP request.
|
protected HttpServletResponse |
response
Object used for preparing HTTP response.
|
protected ResultSet |
rs
Object containing the result set.
|
protected ResultSetMetaData |
rsmd
Object containing meta data on result set.
|
Constructor and Description |
---|
CsvWriter.Instance(HttpServletRequest req,
HttpServletResponse res) |
Modifier and Type | Method and Description |
---|---|
int |
getColumnCount()
Obtains number of columns in result set
|
DatabaseProperties |
getDatabaseProperties() |
String |
getMessage()
Getter for message.
|
String |
getOutputFilename() |
PrintWriter |
getPrintWriter()
Getter for output.
|
HttpServletRequest |
getRequest()
Getter for request.
|
HttpServletResponse |
getResponse()
Getter for response.
|
ResultSet |
getResultSet()
Getter for rs.
|
ResultSetMetaData |
getResultSetMetaData()
Getter for rsmd.
|
void |
setColumnCount(int value)
Sets number of columns in result set.
|
void |
setDatabaseProperties(DatabaseProperties value) |
void |
setOutputFilename(String value) |
void |
setResultSet(ResultSet value)
Setter for rs.
|
void |
setResultSetMetaData(ResultSetMetaData value)
Setter for rsmd.
|
protected HttpServletRequest request
protected HttpServletResponse response
protected String outputFilename
Changes to this field can be made using the setValues method of the enclosing class.
protected String message
Changes to this field can be made by using the setValues method of the enclosing class.
CsvWriter.setValues(Instance)
protected DatabaseProperties data
This field is set by the makeConnection method.
CsvWriter.makeConnection()
protected ResultSet rs
This object is created by the getResultSet method which is called by the service method.
protected ResultSetMetaData rsmd
This object is created by the service method after the execution of the getResultSet method and before the execution of the printHeader method.
Must be moved to inner class
protected PrintWriter output
protected int columnCount
public CsvWriter.Instance(HttpServletRequest req, HttpServletResponse res)
public ResultSet getResultSet()
rs
public void setResultSet(ResultSet value)
This would not normally be called from outside classes.
value
- Value to be used for fieldrs
public ResultSetMetaData getResultSetMetaData()
rsmd
public void setResultSetMetaData(ResultSetMetaData value)
This would not normally be called by external classes.
value
- ResultSetMetaData objectrsmd
public DatabaseProperties getDatabaseProperties()
public void setDatabaseProperties(DatabaseProperties value)
public String getOutputFilename()
public void setOutputFilename(String value)
public int getColumnCount()
columnCount
public void setColumnCount(int value)
This method would not normally be used.
value
- Value to be usedcolumnCount
public PrintWriter getPrintWriter()
output
public String getMessage()
message
public HttpServletRequest getRequest()
request
public HttpServletResponse getResponse()
response