Package anderix.datajets
Class JetSet
java.lang.Object
anderix.datajets.JetSet
The class for initializing DataJet objects and methods. JetSet
describes the connection, table, field list, and (optionally) driver used for a DataJet.
-
Constructor Summary
ConstructorDescriptionJetSet
(ConnectionGenerator generator, TableDefinition definition) Constructor.JetSet
(ConnectionGenerator generator, String table, String[] fieldList) Constructor.JetSet
(String driver, String connectionString, TableDefinition definition) Constructor.Constructor.Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Closes the connection object.Creates a new java.sql.Connection object based on the connection information supplied to the DataJet.Creates a SqlBuilder based on the table and fields specified by DataJet.Returns the ConnectionGenerator that was supplied to the DataJet.Returns the connection string that was supplied to the DataJet.Returns the driver name that was supplied to the DataJet.String[]
Returns the field names for the DataJet.getFieldName
(int fieldIndex) Returns the name of the field indentified byfieldIndex
.getTable()
Returns the table name for the DataJet.int
Finds the index of a field that matchesfieldName
.void
setConnection
(ConnectionGenerator newvalue) Sets the connection information for the DataJet.void
setConnection
(String driverValue, String connectionStringValue) Sets the connection information for the DataJet.void
setFieldList
(String[] newvalues) Sets the field names for the DataJet.void
setTable
(TableDefinition tableDef) Sets the table name and the field names for the DataJet using a TableDefinition object.void
Sets the table name for the DataJet.void
Sets the table name and the field names for the DataJet.
-
Constructor Details
-
JetSet
Constructor.- Parameters:
connectionString
- string representing the connection to the databasetable
- string name of the DataJet's tablefieldList
- array of strings containing the field names, with the identity field in the zeroth ordinal position
-
JetSet
Constructor.- Parameters:
driver
- string representing the database driver to use to create a connectionconnectionString
- string representing the connection to the databasetable
- string name of the DataJet's tablefieldList
- array of strings containing the field names, with the identity field in the zeroth ordinal position
-
JetSet
Constructor.- Parameters:
generator
- ConnectionGenerator that defines connection for the DataJettable
- string name of the DataJet's tablefieldList
- array of strings containing the field names, with the identity field in the zeroth ordinal position
-
JetSet
Constructor.- Parameters:
driver
- string representing the database driver to use to create a connectionconnectionString
- string representing the connection to the databasedefinition
- TableDefinition object that describes the physical database table.
-
JetSet
Constructor.- Parameters:
generator
- ConnectionGenerator that defines connection for the DataJetdefinition
- TableDefinition object that describes the physical database table.
-
-
Method Details
-
indexOf
Finds the index of a field that matchesfieldName
. Returns zero (0) if no match is found.- Parameters:
fieldName
- name of the field to find- Returns:
- int value representing index of matching field
-
getFieldName
Returns the name of the field indentified byfieldIndex
.- Parameters:
fieldIndex
- the index of the field to return- Returns:
- string name of the field
-
setConnection
Sets the connection information for the DataJet.- Parameters:
newvalue
- ConnectionGenerator containing connection information for the DataJet- See Also:
-
setConnection
Sets the connection information for the DataJet.- Parameters:
driverValue
- string containing driver information for the DataJetconnectionStringValue
- string containing connection url for the DataJet
-
createConnection
Creates a new java.sql.Connection object based on the connection information supplied to the DataJet.- Returns:
- Connection object for the DataJet
- Throws:
DataJetException
- if the connection information has not been supplied or is invalid
-
closeConnection
Closes the connection object.- Parameters:
con
- Connection to close.
-
getConnectionString
Returns the connection string that was supplied to the DataJet. If no connection string has been specified, or if a ConnectionGenerator was specified, returns null.- Returns:
- connection string
-
getDriver
Returns the driver name that was supplied to the DataJet. If no driver name has been specified, or if a ConnectionGenerator was specified, returns null.- Returns:
- string representing driver name
-
getConnectionGenerator
Returns the ConnectionGenerator that was supplied to the DataJet. If no ConnectionGenerator was supplied, returns null.- Returns:
- the DataJet's ConnectionGenerator
- See Also:
-
setTable
Sets the table name and the field names for the DataJet.- Parameters:
tableName
- string name of the tablefieldNames
- array of strings containing the field names, with the identity field in the zeroth ordinal position
-
setTable
Sets the table name and the field names for the DataJet using a TableDefinition object.- Parameters:
tableDef
- TableDefinition object to set table and field names
-
setTable
Sets the table name for the DataJet.- Parameters:
newvalue
- string name of the table
-
getTable
Returns the table name for the DataJet.- Returns:
- string table name
-
setFieldList
Sets the field names for the DataJet.- Parameters:
newvalues
- array of strings containing field names, with the identity field in the zeroth ordinal position
-
getFieldList
Returns the field names for the DataJet.- Returns:
- array of strings representing field names
-
createSqlBuilder
Creates a SqlBuilder based on the table and fields specified by DataJet.- Returns:
- SqlBuilder object based on table and fields specified by DataJet
- See Also:
-