|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnl.gx.webmanager.services.seo.dao.impl.SEODatabaseUtil
public final class SEODatabaseUtil
SEO related database utility class.
| Constructor Summary | |
|---|---|
SEODatabaseUtil(InternalSEOService seoService)
Constructor. |
|
| Method Summary | |
|---|---|
protected static void |
close(java.sql.Connection connection,
java.sql.Statement stmt,
java.sql.ResultSet rs)
Convenience method to close resources in a safe way. |
protected int |
executeInsert(java.lang.String query,
java.util.List<java.lang.Object> arguments)
Executes updates the given query with its arguments. |
protected java.lang.String[] |
executeStringSelectColumns(java.lang.String query,
java.util.List<java.lang.Object> arguments,
int numberOfColumns)
Executes a query returning an array of string values. |
protected void |
executeUpdate(java.lang.String query,
java.util.List<java.lang.Object> arguments)
Execute updates the given query with its arguments. |
protected java.sql.Connection |
getConnection()
Returns a new connection to this database. |
protected static java.lang.String |
getCurrentDateFunctionReplacement()
Returns the current date function string replacement. |
protected java.lang.String |
getSEODataSourceName()
Returns the datasource name of SEO. |
protected static java.lang.String |
getStringLengthFunctionReplacement()
Returns the string length function name string replacement. |
static void |
logSQL(java.util.logging.Logger log,
java.lang.String methodName,
java.lang.String query,
java.util.List<java.lang.Object> arguments,
long start)
Logs an SQL message on level FINEST. |
protected static void |
setArguments(java.sql.PreparedStatement stmt,
java.util.List<java.lang.Object> arguments)
Convenience method to set an array of arguments on the prepared statement. |
protected static java.lang.String |
setDatabaseSpecificFunctions(java.sql.Connection connection,
java.lang.String query)
Sets database specific functions. |
static long |
startLogSQL(java.util.logging.Logger log)
Returns current time in milliseconds if FINEST messages are loggable on the given log. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SEODatabaseUtil(InternalSEOService seoService)
seoService - Reference to the SEO service.| Method Detail |
|---|
public static long startLogSQL(java.util.logging.Logger log)
log - Log.
public static void logSQL(java.util.logging.Logger log,
java.lang.String methodName,
java.lang.String query,
java.util.List<java.lang.Object> arguments,
long start)
log - Log.methodName - Method name.query - SQL query.arguments - Arguments.start - Time in milliseconds the query was about to be executed.
protected java.sql.Connection getConnection()
throws java.sql.SQLException
java.sql.SQLException - If a connection to this database could not be returned.protected java.lang.String getSEODataSourceName()
protected void executeUpdate(java.lang.String query,
java.util.List<java.lang.Object> arguments)
throws java.sql.SQLException
setDatabaseSpecificFunctions(Connection, String) before preparing the query.
query - Execute this CUD query.arguments - The arguments for the given query.
java.sql.SQLException - If a database access error occurs.
protected int executeInsert(java.lang.String query,
java.util.List<java.lang.Object> arguments)
throws java.sql.SQLException
query - Execute this insert query.arguments - The arguments for the given query.
java.sql.SQLException - If a database access error occurs.
protected java.lang.String[] executeStringSelectColumns(java.lang.String query,
java.util.List<java.lang.Object> arguments,
int numberOfColumns)
throws java.sql.SQLException
setDatabaseSpecificFunctions(Connection, String) before preparing the
query.
query - Query to execute.arguments - The arguments for the given query.numberOfColumns - Number of columns to retrieve string values from.
java.sql.SQLException - If a database access error occurs.
protected static void setArguments(java.sql.PreparedStatement stmt,
java.util.List<java.lang.Object> arguments)
throws java.sql.SQLException
stmt - Set the arguments on this statement.arguments - Array of arguments.
java.sql.SQLException - If a database access error occurs.
protected static void close(java.sql.Connection connection,
java.sql.Statement stmt,
java.sql.ResultSet rs)
throws java.sql.SQLException
connection - Close this connection. Can be null.stmt - Close this statement. Can be null.rs - Close this result set. Can be null.
java.sql.SQLException - Occurs If a database access error occurs.protected static java.lang.String getCurrentDateFunctionReplacement()
setDatabaseSpecificFunctions(Connection, String) so that this replacement string is replaced
with the correct current date function.
getdate()protected static java.lang.String getStringLengthFunctionReplacement()
setDatabaseSpecificFunctions(Connection, String) so that this replacement string is replaced
with the correct string length function name.
len()
protected static java.lang.String setDatabaseSpecificFunctions(java.sql.Connection connection,
java.lang.String query)
throws java.sql.SQLException
connection - Connection to invest database product name.query - Input query.
java.sql.SQLException - If database product name could not be determined.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||