Whatever message this page gives is out now! Go check it out!
public abstract interface Query |
| Returns | Method | Description |
int | addRow()(in CCFXQuery class ) | Adds a row to the query |
int | getColumnIndex (String name) | Gets the index of a column given its name |
String[] | getColumns () | Gets a list of the column names in a query |
String | getData (int iRow, int iCol) | Gets a data element from a row and column of a query |
String | getName () | Gets the name of a query |
int | getRowCount () | Gets the number of rows in a query |
void | setData (int iRow, int iCol, String data) | Sets a data element in a row and column of a query |
public int addRow() |
// Define column indexes int iCity = 1, iState = 2, iZip = 3 ; // First row int iRow = query.addRow() ; query.setData( iRow, iCity, "Minneapolis" ) ; query.setData( iRow, iState, "MN" ) ; query.setData( iRow, iZip, "55345" ) ; // Second row iRow = query.addRow() ; query.setData( iRow, iCity, "St. Paul" ) ; query.setData( iRow, iState, "MN" ) ; query.setData( iRow, iZip, "55105" ) ; |
public int getColumnIndex(String name) |
| Parameter | Description |
name | Name of column to get index of (lookup is case-insensitive) |
// Get the index of the EMAIL column int iEMail = query.getColumnIndex( "EMAIL" ) ; // Iterate over the query and output list of addresses int nRows = query.getRowCount() ; for( int iRow = 1; iRow <= nRows; iRow++ ) { response.write( query.getData( iRow, iEMail ) + "<BR>" ) ; } |
public String[] getColumns() |
// Get the list of columns from the query String[] columns = query.getColumns() ; int nNumColumns = columns.length ; // Print the list of columns to the user response.write( "Columns in query: " ) ; for( int i=0; i<nNumColumns; i++ ) { response.write( columns[i] + " " ) ; } |
public String getData(int iRow, int iCol) |
| Parameter | Description |
iRow | Row to retrieve data from (1-based) |
iCol | Column to retrieve data from (1-based) |
int iRow, iCol ; int nNumCols = query.getColumns().length ; int nNumRows = query.getRowCount() ; for ( iRow = 1; iRow <= nNumRows; iRow++ ) { for ( iCol = 1; iCol <= nNumCols; iCol++ ) { response.write( query.getData( iRow, iCol ) + " " ) ; } response.write( "<BR>" ) ; } |
public String getName() |
Query query = request.getQuery() ; response.write( "The query name is: " + query.getName() ) ; |
Query query = request.getQuery() ; int rows = query.getRowCount() ; response.write( "The number of rows in the query is " + Integer.ToString(rows) ) ; |
public void setData(int iRow, int iCol, String data) |
| Parameter | Description |
iRow | Row of data element to set (1-based) |
iCol | Column of data element to set (1-based) |
data | New value for data element |
// Define column indexes int iCity = 1, iState = 2, iZip = 3 ; // First row int iRow = query.addRow() ; query.setData( iRow, iCity, "Minneapolis" ) ; query.setData( iRow, iState, "MN" ) ; query.setData( iRow, iZip, "55345" ) ; // Second row iRow = query.addRow() ; query.setData( iRow, iCity, "St. Paul" ) ; query.setData( iRow, iState, "MN" ) ; query.setData( iRow, iZip, "55105" ) ; |