Package org.apache.velocity.runtime.resource.loader

# Interface DatabaseObjectsFactory

All Known Implementing Classes:
  `DefaultDatabaseObjectsFactory`

public interface DatabaseObjectsFactory
Factory for creating connections and prepared statements

## Method Summary

Modifier and Type
Method
Description
`default void`
`clear()`
Free resources
`void`
`init(DataSource dataSource, ExtProperties properties)`
Initialize the factory with the DataSourceResourceLoader properties
`PreparedStatement`
`prepareStatement(String sql)`
Prepare a statement
`void`
`releaseStatement(String sql, PreparedStatement stmt)`
Releases a prepared statement
`default void`
`setLogger(org.slf4j.Logger log)`
Set the logger to be used by the factory

## Method Details

### init

void init(DataSource dataSource, ExtProperties properties) throws SQLException
Initialize the factory with the DataSourceResourceLoader properties

Parameters:
  `dataSource` - data source
Throws:
  `SQLException`

### setLogger

default void setLogger(org.slf4j.Logger log)
Set the logger to be used by the factory

Parameters:
  `log` -

### prepareStatement

PreparedStatement prepareStatement(String sql) throws SQLException
Prepare a statement

Parameters:
  `sql` - Statement SQL
Returns:
  prepared statement
Throws:
  `SQLException`

### releaseStatement

void releaseStatement(String sql, PreparedStatement stmt) throws SQLException
Releases a prepared statement

Parameters:
  `sql` - original sql query
  `stmt` - statement
Throws:
  `SQLException`

### clear

default void clear()
Free resources