Class DefaultDatabaseObjectsFactory
java.lang.Object
org.apache.velocity.runtime.resource.loader.DefaultDatabaseObjectsFactory
- All Implemented Interfaces:
DatabaseObjectsFactory
@Deprecated
public class DefaultDatabaseObjectsFactory
extends Object
implements DatabaseObjectsFactory
Deprecated.
Database objects factory which obtains a new connection from the data source and
prepares a statement at each call.
The returned PreparedStatement is a proxy that remembers the connection
it was created from and returns it via Statement.getConnection().
This keeps the releaseStatement(String, PreparedStatement) contract
correct across JDBC pool implementations — in particular Tomcat JDBC Pool, whose
default facade returns the unwrapped driver connection and would bypass the pool
wrapper on close.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinit(DataSource dataSource, ExtProperties properties) Deprecated.Initialize the factory with the DataSourceResourceLoader propertiesprepareStatement(String sql) Deprecated.Prepare a statementvoidreleaseStatement(String sql, PreparedStatement stmt) Deprecated.Releases a prepared statementMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.velocity.runtime.resource.loader.DatabaseObjectsFactory
clear, setLogger
-
Constructor Details
-
DefaultDatabaseObjectsFactory
public DefaultDatabaseObjectsFactory()Deprecated.
-
-
Method Details
-
init
Deprecated.Initialize the factory with the DataSourceResourceLoader properties- Specified by:
initin interfaceDatabaseObjectsFactory- Parameters:
dataSource- data source
-
prepareStatement
Deprecated.Prepare a statement- Specified by:
prepareStatementin interfaceDatabaseObjectsFactory- Parameters:
sql- Statement SQL- Returns:
- prepared statement
- Throws:
SQLException
-
releaseStatement
Deprecated.Releases a prepared statement- Specified by:
releaseStatementin interfaceDatabaseObjectsFactory- Parameters:
sql- original sql querystmt- statement- Throws:
SQLException
-
DefaultPreparedStatementsFactoryvia thePreparedStatementsFactorySPI.