Class DefaultDatabaseObjectsFactory
java.lang.Object
org.apache.velocity.runtime.resource.loader.DefaultDatabaseObjectsFactory
- All Implemented Interfaces:
DatabaseObjectsFactory
Database objects factory which will obtain a new connection from the data source and prepare needed statements
at each call
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
init
(DataSource dataSource, ExtProperties properties) Initialize the factory with the DataSourceResourceLoader propertiesprepareStatement
(String sql) Prepare a statementvoid
releaseStatement
(String sql, PreparedStatement stmt) Releases a prepared statementMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.velocity.runtime.resource.loader.DatabaseObjectsFactory
clear, setLogger
-
Constructor Details
-
DefaultDatabaseObjectsFactory
public DefaultDatabaseObjectsFactory()
-
-
Method Details
-
init
Initialize the factory with the DataSourceResourceLoader properties- Specified by:
init
in interfaceDatabaseObjectsFactory
- Parameters:
dataSource
- data source
-
prepareStatement
Prepare a statement- Specified by:
prepareStatement
in interfaceDatabaseObjectsFactory
- Parameters:
sql
- Statement SQL- Returns:
- prepared statement
- Throws:
SQLException
-
releaseStatement
Releases a prepared statement- Specified by:
releaseStatement
in interfaceDatabaseObjectsFactory
- Parameters:
sql
- original sql querystmt
- statement- Throws:
SQLException
-