All Packages Class Hierarchy This Package Previous Next Index
Class org.xmlmiddleware.xmldbms.datahandlers.SQLStrings
java.lang.Object
|
+----org.xmlmiddleware.xmldbms.datahandlers.SQLStrings
- public class SQLStrings
- extends Object
Get SELECT, UPDATE, INSERT, and DELETE strings.
The class caches all strings except UPDATE strings, calling DMLGenerator
to generate new strings as needed.
- Version:
- 2.0
- Author:
- Sean Walter, 2001
- See Also:
- DMLGenerator
-
SQLStrings(Connection)
- Construct a new SQLStrings.
-
SQLStrings(DMLGenerator)
- Construct a new SQLStrings.
-
getDelete(Table, Key)
- Returns a DELETE SQL string for a given table.
-
getDeleteWhere(Table, Key, String)
- Returns a "DELETE FROM Table WHERE key = ? AND <where>" SQL string for a
given table.
-
getInsert(Table)
- Returns an INSERT SQL string for the given table.
-
getSelectKey(Table, Key)
- Returns a "SELECT key WHERE key = ?" SQL string for a given table.
-
getSelectRow(Table, Key, OrderInfo)
- Returns a "SELECT * WHERE key = ? ORDER BY ?" SQL string for a
given table.
-
getSelectWhere(Table, Key, String, OrderInfo)
- Returns a "SELECT * WHERE key = ? AND <where> ORDER BY ?" SQL string for a
given table.
-
getUpdate(Table, Key, Column[])
- Returns an UPDATE SQL string for a given table, key, and set of columns.
SQLStrings
public SQLStrings(Connection conn) throws SQLException
- Construct a new SQLStrings.
- Parameters:
- conn - A database connection. This is used to get database metadata.
- Throws: SQLException
- Thrown if a database exception occurs while
getting the database metadata.
SQLStrings
public SQLStrings(DMLGenerator dml)
- Construct a new SQLStrings.
- Parameters:
- dml - A DMLGenerator.
getInsert
public String getInsert(Table t)
- Returns an INSERT SQL string for the given table.
- Parameters:
- t - The table. Must not be null.
- Returns:
- The INSERT string.
getSelectRow
public String getSelectRow(Table t,
Key key,
OrderInfo order)
- Returns a "SELECT * WHERE key = ? ORDER BY ?" SQL string for a
given table.
- Parameters:
- t - The table to select from. Must not be null.
- key - The key to restrict with.
- order - The sort information. May be null.
- Returns:
- The SELECT string.
getSelectKey
public String getSelectKey(Table t,
Key key)
- Returns a "SELECT key WHERE key = ?" SQL string for a given table.
- Parameters:
- t - The table to select from. Must not be null.
- key - The key to restrict with.
- Returns:
- The SELECT string.
getSelectWhere
public String getSelectWhere(Table t,
Key key,
String where,
OrderInfo order)
- Returns a "SELECT * WHERE key = ? AND <where> ORDER BY ?" SQL string for a
given table.
- Parameters:
- t - The table to select from. Must not be null.
- key - The key to restrict with. May be null.
- where - An additional where clause. May be null.
- order - The sort information. May be null.
- Returns:
- The SELECT string.
getUpdate
public String getUpdate(Table t,
Key key,
Column cols[])
- Returns an UPDATE SQL string for a given table, key, and set of columns.
- Parameters:
- t - The table to update. Must not be null.
- key - The key to restrict with. Must not be null.
- cols - The columns to update. If this is null, all columns are included.
- Returns:
- The UPDATE string.
getDelete
public String getDelete(Table t,
Key key)
- Returns a DELETE SQL string for a given table.
- Parameters:
- t - The table to delete from. Must not be null.
- key - The key to restrict with. Must not be null.
- Returns:
- The DELETE string.
getDeleteWhere
public String getDeleteWhere(Table t,
Key key,
String where)
- Returns a "DELETE FROM Table WHERE key = ? AND <where>" SQL string for a
given table.
- Parameters:
- t - The table to select from. Must not be null.
- key - The key to restrict with. May be null.
- where - An additional where clause. May be null.
- Returns:
- The DELETE string.
All Packages Class Hierarchy This Package Previous Next Index