|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DialectFactory
Factory that creates Dialect
objects.
If you create a class that implements Dialect
, you may optionally
provide a factory by creating a constant field in that class. For
example:
public class MyDialect implements Dialect { public static final DialectFactory FACTORY = new JdbcDialectFactory(MyDialect.class, null); public MyDialect(Connection connection) { ... } ... }
(The field must be public, static, final, named "FACTORY", of type
DialectFactory
or a subclass, and its value must not be
null.)
Explicitly providing a factory gives you more control about how dialects are produced.
If you do not provide such a field, Mondrian requires that the dialect has
a public constructor that takes a Connection
as a parameter,
and automatically creates a factory that calls the class's public
constructor.
However, an explicit DialectFactory is superior:
null
, whereas a dialect's constructor can only throw an
exception.
If your dialect is a subclass of JdbcDialectImpl
you may wish to use a dialect factory that is a subclass of
JdbcDialectFactory
.
Method Summary | |
---|---|
Dialect |
createDialect(javax.sql.DataSource dataSource,
java.sql.Connection connection)
Creates a Dialect. |
Method Detail |
---|
Dialect createDialect(javax.sql.DataSource dataSource, java.sql.Connection connection)
If the dialect cannot handle this connection, returns null.
dataSource
- JDBC data sourceconnection
- JDBC connection
java.lang.RuntimeException
- if underlying systems give an error
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |