public class IlvJDBCQueryParameters extends Object
Constructor and Description |
---|
IlvJDBCQueryParameters(Element parentElement,
Element queryElement)
Creates query parameters from a DOM element.
|
IlvJDBCQueryParameters(String query,
IlvJDBCConnectionParameters connection,
IlvTableModelMapper mapper)
Creates a new set of parameters for an SQL query.
|
IlvJDBCQueryParameters(String query,
Object[] queryParameters,
IlvJDBCConnectionParameters connection,
IlvTableModelMapper mapper)
Creates a new set of parameters for an SQL query.
|
Modifier and Type | Method and Description |
---|---|
static IlvJDBCQueryParameters |
deserialize(Element parentElement,
Element queryElement)
Loads query parameters from a DOM element.
|
IlvJDBCConnectionParameters |
getConnection()
Returns the database connection parameters.
|
IlvTableModelMapper |
getMapper()
Returns the table mapper used to map the results of the query
to a Swing TableModel.
|
String |
getQuery()
Returns the SQL query string, potentially with question marks as placeholders
for the parameters.
|
Object[] |
getQueryParameters()
Returns the parameters of the query, or
null or an empty array
if there are none. |
Element |
serialize(Element element)
Saves these query parameters to a DOM element.
|
public IlvJDBCQueryParameters(String query, IlvJDBCConnectionParameters connection, IlvTableModelMapper mapper)
query
- The SQL query string. In this query, every parameter should be
validated, to prevent SQL injection attacks.connection
- The parameters of the database connection.mapper
- The table mapper used to map the results of the query
to a Swing TableModel.public IlvJDBCQueryParameters(String query, Object[] queryParameters, IlvJDBCConnectionParameters connection, IlvTableModelMapper mapper)
query
- The query to execute, with a question mark placeholder for
each parameter.queryParameters
- Parameters of the query.connection
- The parameters of the database connection.mapper
- The table mapper used to map the results of the query
to a Swing TableModel.public IlvJDBCQueryParameters(Element parentElement, Element queryElement) throws Exception
parentElement
- The DOM element to where the connection parameters
where saved (that is, the element
parameters that was
passed to serialize(org.w3c.dom.Element)
when the query parameters were saved).queryElement
- The DOM element to read the query parameters from.Exception
- If an error occurred while loading the parameters.public final String getQuery()
public final Object[] getQueryParameters()
null
or an empty array
if there are none.null
.public final IlvJDBCConnectionParameters getConnection()
public final IlvTableModelMapper getMapper()
public Element serialize(Element element) throws SQLException
element
- The DOM element to save to.SQLException
public static IlvJDBCQueryParameters deserialize(Element parentElement, Element queryElement) throws Exception
parentElement
- The DOM element to where the connection parameters
where saved (that is, the element
parameters that was
passed to serialize(org.w3c.dom.Element)
when the query parameters were saved).queryElement
- The DOM element to read the query parameters from.Exception
- If an error occurred while loading the parameters.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.