Class JDBCTypeSettings
- java.lang.Object
-
- com.spotfire.ws.im.ds.sql.JDBCTypeSettings
-
public class JDBCTypeSettings extends Object
Settings for a JDBC data source type.
The settings are loaded from datasource templates.
- Since:
- 3.0
- Author:
- Magnus Rylander
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JDBCTypeSettings.TypeMapping
Mapping between a Java and a SQL type.
-
Constructor Summary
Constructors Constructor Description JDBCTypeSettings()
Creates a newJDBCTypeSettings
instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTypeMapping(JDBCTypeSettings.TypeMapping t)
Add a Java to SQL type mapping.static JDBCTypeSettings[]
getAllTypeSettings()
Returns allJDBCTypeSettings
instances that are currently enabled.boolean
getAlwaysUsePreparedStatement()
Indicates if prepared statement should be used even when no parameters are set.boolean
getAutocommit()
Get autocommit mode.int
getBatchSize()
Returns the batch size that specifies the amount of data in each batch update.String
getCatalogNamePattern()
Returns the pattern used to format a catalog name in an SQL query.String
getColumnAliasPattern()
Returns the pattern used to format a column alias in an SQL query.String
getColumnNamePattern()
Returns the pattern used to format a column name in an SQL query.int
getConditionListThreshold()
Return the condition list threshold.Properties
getConnectionProperties()
Returns the connection properties used when creating a new connection to the database.String[]
getCreateTempTableCommands()
Returns the SQL commands needed for creating a temporary table that is used to store filter values (when more than 'condition-list-threshold') and to store result from subqueries.int
getCredentialsTimeout()
Gets the credentials timeout for a JDBC data source.String
getDateFormatExpression()
Returns an expression that converts a date field to a string value on the format:"YYYY-MM-DD", e.g.String
getDateLiteralFormatExpression()
Returns an expression that converts a date literal to a database date value.String
getDateTimeFormatExpression()
Returns an expression that converts a datetime field to string value on the format: "YYYY-MM-DD HH:MM:SS", e.g.String
getDateTimeLiteralFormatExpression()
Returns an expression that converts a datetime literal to a database datetime value.String
getDisplayName()
Returns the name of the JDBC type to be displayed in a UI.String
getDriverClass()
Returns the JDBC driver class.String[]
getDropTempTableCommands()
Returns the SQL commands for deleting a temporary table.boolean
getExpandInClause()
Tells if an SQL IN-clause shall be expanded into OR conditions.int
getFetchSize()
Returns the fetch size that specifies the amount of data fetched with each database round trip for a query.int
getLobThreshold()
Returns the threshold value when LOB values used as parameters in a WHERE clause, must be written in temporary tables.int
getMaxColumnNameLength()
Returns the maximum length allowed for column names.int
getMaxInClauseSize()
Returns the maximum size of an SQL IN-clause.Class
getMetadataProviderClass()
Returns theJDBCMetadataProvider
class.int
getMinInClauseSize()
Returns the minimum number of values for creating a SQL IN-clause.String
getPingCommand()
Returns the ping command used to verify a JDBC connection.String
getProcedureExpressionPattern()
Return the pattern that determines how a procedure expression is written in the SQL query.String
getProcedureNamePattern()
Returns the pattern used to format a procedure name in an SQL query.int
getProcedureTableJDBCType()
Returns the JDBC type for procedure tables.String
getProcedureTableTypeName()
Returns the type name for procedure tables.Class
getQueryBuilderClass()
Returns the query builder class.String
getSchemaNamePattern()
Returns the pattern used to format a schema name in an SQL query.String
getSQLAggregateFuntion(String datAggregateFuntion)
Get the SQL aggregate function for the given DAT aggregate function, or null if no such SQL function exists.Class
getSQLFilterClass()
Returns theSQLFilter
class.Class
getSQLRuntimeClass()
Returns theSQLRuntime
class.String
getSQLType(Class javaType)
Returns the SQL type for a given Java type.String
getSQLType(Class javaType, int length)
Returns the SQL type for a given Java type.String
getStringLiteralQuote()
Returns The character used as quote for string literals.String
getTableExpressionPattern()
Return the pattern that determines how a table expression is written in the SQL query.String
getTableNamePattern()
Returns the pattern used to format a table name in an SQL query.String[]
getTableTypes()
String
getTempTableNamePattern()
Returns the pattern used to format a temporary table name in an SQL command.String
getTimeFormatExpression()
Returns an expression that converts a time field to a string value on the format:"HH:MM:SS", e.g.String
getTimeLiteralFormatExpression()
Returns an expression that converts a time literal to a database time value.JDBCTypeSettings.TypeMapping[]
getTypeMappings()
Returns all Java to SQL type mappings.String
getTypeName()
Returns the name of the JDBC type.String
getURLPattern()
Returns the URL pattern.boolean
isAnsiiStyleOuterJoin()
Returns if an attempt should be done to go from oracle outer join syntax with '(+)' to ANSI form If useAnsiJoin() is true, then this setting has no effect.boolean
isAnsiJoin()
Returns if an attempt should be made to create ansi join syntax.void
setAlwaysUsePreparedStatement(boolean alwaysUsePreparedStatement)
Indicates if prepared statement should be used even when no parameters are set.void
setAnsiiStyleOuterJoin(boolean outerJoin)
Set if an attempt should be done to go from oracle outer join syntax with '(+)' to ANSI form If useAnsiJoin() is true, then this setting has no effect.void
setAnsiJoin(boolean useAnsiJoin)
Set if an attempt should be made to create ansi join syntax.void
setAutocommit(boolean autocommit)
Sets the auto commit mode for connection on the data source.void
setBatchSize(int size)
Sets the batch size that specifies the amount of data in each batch update.void
setCatalogNamePattern(String p)
Sets the pattern used to format a catalog name in an SQL query.void
setColumnAliasPattern(String p)
Sets the pattern used to format a column alias in an SQL query.void
setColumnNamePattern(String p)
Sets the pattern used to format a column name in an SQL query.void
setConditionListThreshold(int i)
Sets the condition list threshold.void
setConnectionProperties(Properties connectionProperties)
Sets the connection properties used when creating a new connection to the database.void
setCreateTempTableCommands(String[] s)
Sets the SQL commands needed for creating a temporary table that is used to store filter values (when more than 'condition-list-threshold') and to store result from subqueries.void
setCredentialsTimeout(int credentialsTimeout)
Sets the credentials timeout for a JDBC data source.void
setDateFormatExpression(String s)
Sets an expression that converts a date field to a string value on the format:"YYYY-MM-DD", e.g.void
setDateLiteralFormatExpression(String s)
Sets an expression that converts a date literal to a database date value.void
setDateTimeFormatExpression(String s)
Sets an expression that converts a datetime field to string value on the format: "YYYY-MM-DD HH:MM:SS", e.g.void
setDateTimeLiteralFormatExpression(String s)
Sets an expression that converts a datetime literal to a database datetime value.void
setDriverClass(String c)
Sets the JDBC driver class.void
setDropTempTableCommands(String[] s)
Sets the SQL commands for deleting a temporary table.void
setExpandInClause(boolean b)
Sets if an SQL IN-clause shall be expanded into OR conditions.void
setFetchSize(int size)
Sets the fetch size that specifies the amount of data fetched with each database round trip for a query.void
setLobThreshold(int i)
Sets the threshold value when LOB values used as parameters in a WHERE clause, must be written in temporary tables.void
setMaxColumnNameLength(int i)
Sets the maximum length allowed for database column names.void
setMaxInClauseSize(int i)
Size the maximum size of an SQL IN-clause.void
setMetadataProviderClass(Class c)
Sets theJDBCMetadataProvider
class.void
setMinInClauseSize(int i)
Sets the minimum number of values for creating a SQL IN-clause.void
setPingCommand(String s)
Sets the ping command used to verify a JDBC connection.void
setProcedureExpressionPattern(String s)
Sets the pattern that determines how a procedure expression is written in the SQL query.void
setProcedureNamePattern(String p)
Sets the pattern used to format a procedure name in an SQL query.void
setProcedureTableJDBCType(int type)
Sets the JDBC type for procedure tables.void
setProcedureTableTypeName(String typeName)
Sets the type name for procedure tables.void
setSchemaNamePattern(String p)
Sets the pattern used to format a schema name in an SQL query.void
setSQLFilterClass(Class c)
Sets theSQLFilter
class.void
setSQLRuntimeClass(Class c)
Sets theSQLRuntime
class.void
setStringLiteralQuote(String s)
Sets The character used as quote for string literals.void
setSupportsCatalogs(boolean b)
Sets if the catalog level is supported in metadata.void
setSupportsDistinct(boolean b)
Sets if the DISTINCT keyword is supported in SQL queries.void
setSupportsOrderBy(boolean b)
Sets if the ORDER BY keyword is supported in SQL queries.void
setSupportsProcedures(boolean b)
Sets if procedures are supported in metadata.void
setSupportsSchemas(boolean b)
Sets if the schema level is supported in metadata.void
setTableExpressionPattern(String s)
Sets the pattern that determines how a table expression is written in the SQL query.void
setTableNamePattern(String p)
Sets the pattern used to format a table name in an SQL query.void
setTableTypes(String[] types)
void
setTempTableNamePattern(String p)
Sets the pattern used to format a temporary table name in an SQL command.void
setTimeFormatExpression(String s)
Sets an expression that converts a time field to a string value on the format:"HH:MM:SS", e.g.void
setTimeLiteralFormatExpression(String s)
Sets an expression that converts a time literal to a database time value.void
setTypeMappings(JDBCTypeSettings.TypeMapping[] t)
Sets all Java to SQL type mappings.void
setTypeName(String name)
Sets the name of the JDBC type.void
setURLPattern(String s)
Sets the URL pattern.boolean
supportsCatalogs()
Tells if the catalog level is supported in metadata.boolean
supportsDistinct()
Tells if the DISTINCT keyword is supported in SQL queries.boolean
supportsOrderBy()
Tells if the ORDER BY clause is supported in SQL queries.boolean
supportsProcedures()
Tells if procedures are supported in metadata.boolean
supportsSchemas()
Tells if the schema level is supported in metadata.String
toString()
Return a string showing the values of all the members.
-
-
-
Method Detail
-
getAllTypeSettings
public static JDBCTypeSettings[] getAllTypeSettings()
Returns allJDBCTypeSettings
instances that are currently enabled.- Returns:
- all
JDBCTypeSettings
instances - Since:
- 3.0
-
getTypeName
public String getTypeName()
Returns the name of the JDBC type.- Returns:
- a type name
- Since:
- 3.0
-
setTypeName
public void setTypeName(String name)
Sets the name of the JDBC type.- Parameters:
name
- a type name- Since:
- 3.0
-
getDisplayName
public String getDisplayName()
Returns the name of the JDBC type to be displayed in a UI.- Returns:
- a display name
- Since:
- 3.0
-
getDriverClass
public String getDriverClass()
Returns the JDBC driver class.- Returns:
- a class name
- Since:
- 3.0
-
setDriverClass
public void setDriverClass(String c)
Sets the JDBC driver class.- Parameters:
c
- a class name- Since:
- 3.0
-
getURLPattern
public String getURLPattern()
Returns the URL pattern.- Returns:
- a URL pattern
String
- Since:
- 3.0
-
setURLPattern
public void setURLPattern(String s)
Sets the URL pattern.- Parameters:
s
- a URL patternString
- Since:
- 3.0
-
getPingCommand
public String getPingCommand()
Returns the ping command used to verify a JDBC connection.- Returns:
- a ping command
String
- Since:
- 3.0
-
setPingCommand
public void setPingCommand(String s)
Sets the ping command used to verify a JDBC connection.- Parameters:
s
- a ping commandString
- Since:
- 3.0
-
getMetadataProviderClass
public Class getMetadataProviderClass()
Returns theJDBCMetadataProvider
class.- Returns:
- a
Class
derived fromJDBCMetadataProvider
- Since:
- 3.0
- See Also:
JDBCMetadataProvider
-
setMetadataProviderClass
public void setMetadataProviderClass(Class c)
Sets theJDBCMetadataProvider
class.- Parameters:
c
- aClass
derived fromJDBCMetadataProvider
- Since:
- 3.0
- See Also:
JDBCMetadataProvider
-
getSQLFilterClass
public Class getSQLFilterClass()
Returns theSQLFilter
class.- Returns:
- a
Class
derived fromSQLFilter
- Since:
- 3.0
- See Also:
SQLFilter
-
setSQLFilterClass
public void setSQLFilterClass(Class c)
Sets theSQLFilter
class.- Parameters:
c
- aClass
derived fromSQLFilter
- Since:
- 3.0
- See Also:
SQLFilter
-
getSQLRuntimeClass
public Class getSQLRuntimeClass()
Returns theSQLRuntime
class.- Returns:
- a
Class
derived fromSQLRuntime
- Since:
- 3.0
- See Also:
SQLRuntime
-
setSQLRuntimeClass
public void setSQLRuntimeClass(Class c)
Sets theSQLRuntime
class.- Parameters:
c
- aClass
derived fromSQLRuntime
- Since:
- 3.0
- See Also:
SQLRuntime
-
getQueryBuilderClass
public Class getQueryBuilderClass()
Returns the query builder class. The default isSQLBuilder
.- Returns:
- a
Class
for building queries. - Since:
- 3.0
-
getFetchSize
public int getFetchSize()
Returns the fetch size that specifies the amount of data fetched with each database round trip for a query. The fetch size is measured as the number of fields.- Returns:
- a fetch size value
- Since:
- 3.0
-
setFetchSize
public void setFetchSize(int size)
Sets the fetch size that specifies the amount of data fetched with each database round trip for a query. The fetch size is measured as the number of fields.- Parameters:
size
- a fetch size value- Since:
- 3.0
-
getBatchSize
public int getBatchSize()
Returns the batch size that specifies the amount of data in each batch update. The batch size is measured as the number of fields.- Returns:
- a batch size value
- Since:
- 3.0
-
setBatchSize
public void setBatchSize(int size)
Sets the batch size that specifies the amount of data in each batch update. The batch size is measured as the number of fields.- Parameters:
size
- a batch size value- Since:
- 3.0
-
getMaxColumnNameLength
public int getMaxColumnNameLength()
Returns the maximum length allowed for column names.- Returns:
- maximum column name length
- Since:
- 3.0
-
setMaxColumnNameLength
public void setMaxColumnNameLength(int i)
Sets the maximum length allowed for database column names.- Parameters:
i
- maximum column name length- Since:
- 3.0
-
getTableTypes
public String[] getTableTypes()
- Returns:
- clone of tableTypes
- Since:
- 3.0
-
setTableTypes
public void setTableTypes(String[] types)
- Parameters:
types
- types- Since:
- 3.0
-
supportsCatalogs
public boolean supportsCatalogs()
Tells if the catalog level is supported in metadata.- Returns:
true
if the catalog level is supported, false otherwise- Since:
- 3.0
- See Also:
JDBCMetadataProvider
-
setSupportsCatalogs
public void setSupportsCatalogs(boolean b)
Sets if the catalog level is supported in metadata.- Parameters:
b
-true
if the catalog level is supported, false otherwise- Since:
- 3.0
- See Also:
JDBCMetadataProvider
-
supportsSchemas
public boolean supportsSchemas()
Tells if the schema level is supported in metadata.- Returns:
true
if the schema level is supported, false otherwise- Since:
- 3.0
- See Also:
JDBCMetadataProvider
-
setSupportsSchemas
public void setSupportsSchemas(boolean b)
Sets if the schema level is supported in metadata.- Parameters:
b
-true
if the catalog level is supported, false otherwise- Since:
- 3.0
- See Also:
JDBCMetadataProvider
-
supportsProcedures
public boolean supportsProcedures()
Tells if procedures are supported in metadata.- Returns:
true
if procedures are supported, false otherwise- Since:
- 3.0
- See Also:
JDBCMetadataProvider
-
setSupportsProcedures
public void setSupportsProcedures(boolean b)
Sets if procedures are supported in metadata.- Parameters:
b
-true
if procedures are supported, false otherwise- Since:
- 3.0
- See Also:
JDBCMetadataProvider
-
supportsDistinct
public boolean supportsDistinct()
Tells if the DISTINCT keyword is supported in SQL queries.- Returns:
true
if DISTINCT is supported, false otherwise- Since:
- 3.0
-
setSupportsDistinct
public void setSupportsDistinct(boolean b)
Sets if the DISTINCT keyword is supported in SQL queries.- Parameters:
b
-true
if DISTINCT is supported, false otherwise- Since:
- 3.0
-
supportsOrderBy
public boolean supportsOrderBy()
Tells if the ORDER BY clause is supported in SQL queries.- Returns:
true
if ORDER BY is supported, false otherwise- Since:
- 3.0
-
setSupportsOrderBy
public void setSupportsOrderBy(boolean b)
Sets if the ORDER BY keyword is supported in SQL queries.- Parameters:
b
-true
if ORDER BY is supported, false otherwise- Since:
- 3.0
-
getProcedureTableJDBCType
public int getProcedureTableJDBCType()
Returns the JDBC type for procedure tables.- Returns:
- a JDBC type
- Since:
- 3.0
-
setProcedureTableJDBCType
public void setProcedureTableJDBCType(int type)
Sets the JDBC type for procedure tables.- Parameters:
type
- a JDBC type- Since:
- 3.0
-
getProcedureTableTypeName
public String getProcedureTableTypeName()
Returns the type name for procedure tables.- Returns:
- a type name
- Since:
- 3.0
-
setProcedureTableTypeName
public void setProcedureTableTypeName(String typeName)
Sets the type name for procedure tables.- Parameters:
typeName
- a type name- Since:
- 3.0
-
getColumnNamePattern
public String getColumnNamePattern()
Returns the pattern used to format a column name in an SQL query.The name is represented by the tag
$$name$$
.- Returns:
- a column name pattern
String
- Since:
- 3.0
- See Also:
SQLFilter.formatColumnName(java.lang.String)
-
setColumnNamePattern
public void setColumnNamePattern(String p)
Sets the pattern used to format a column name in an SQL query.The name is represented by the tag
$$name$$
.- Parameters:
p
- a column name patternString
- Since:
- 3.0
- See Also:
SQLFilter.formatColumnName(java.lang.String)
-
getTableNamePattern
public String getTableNamePattern()
Returns the pattern used to format a table name in an SQL query.The name is represented by the tag
$$name$$
.- Returns:
- a table name pattern
String
- Since:
- 3.0
- See Also:
SQLFilter.formatTableName(java.lang.String)
-
setTableNamePattern
public void setTableNamePattern(String p)
Sets the pattern used to format a table name in an SQL query.The name is represented by the tag
$$name$$
.- Parameters:
p
- a table name patternString
- Since:
- 3.0
- See Also:
SQLFilter.formatTableName(java.lang.String)
-
getProcedureNamePattern
public String getProcedureNamePattern()
Returns the pattern used to format a procedure name in an SQL query.The name is represented by the tag
$$name$$
.- Returns:
- a procedure name pattern
String
- Since:
- 3.0
-
setProcedureNamePattern
public void setProcedureNamePattern(String p)
Sets the pattern used to format a procedure name in an SQL query.The name is represented by the tag
$$name$$
.- Parameters:
p
- a procedure name patternString
- Since:
- 3.0
-
getSchemaNamePattern
public String getSchemaNamePattern()
Returns the pattern used to format a schema name in an SQL query.The name is represented by the tag
$$name$$
.- Returns:
- a schema name pattern
String
- Since:
- 3.0
- See Also:
SQLFilter.formatSchemaName(java.lang.String)
-
setSchemaNamePattern
public void setSchemaNamePattern(String p)
Sets the pattern used to format a schema name in an SQL query.The name is represented by the tag
$$name$$
.- Parameters:
p
- a schema name patternString
- Since:
- 3.0
- See Also:
SQLFilter.formatSchemaName(java.lang.String)
-
getCatalogNamePattern
public String getCatalogNamePattern()
Returns the pattern used to format a catalog name in an SQL query.The name is represented by the tag
$$name$$
.- Returns:
- a catalog name pattern
String
- Since:
- 3.0
- See Also:
SQLFilter.formatCatalogName(java.lang.String)
-
setCatalogNamePattern
public void setCatalogNamePattern(String p)
Sets the pattern used to format a catalog name in an SQL query.The name is represented by the tag
$$name$$
.- Parameters:
p
- a catalog name patternString
- Since:
- 3.0
- See Also:
SQLFilter.formatCatalogName(java.lang.String)
-
getColumnAliasPattern
public String getColumnAliasPattern()
Returns the pattern used to format a column alias in an SQL query.The name is represented by the tag
$$name$$
.- Returns:
- a column alias pattern
String
- Since:
- 3.0
- See Also:
SQLFilter.formatColumnAlias(java.lang.String)
-
setColumnAliasPattern
public void setColumnAliasPattern(String p)
Sets the pattern used to format a column alias in an SQL query.The alias is represented by the tag
$$name$$
.- Parameters:
p
- a column alias patternString
- Since:
- 3.0
- See Also:
SQLFilter.formatColumnAlias(java.lang.String)
-
getStringLiteralQuote
public String getStringLiteralQuote()
Returns The character used as quote for string literals.- Returns:
- a string literal quote
String
- Since:
- 3.0
- See Also:
SQLFilter.formatLiteral(java.lang.String, java.lang.Class)
-
setStringLiteralQuote
public void setStringLiteralQuote(String s)
Sets The character used as quote for string literals.- Parameters:
s
- a string literal quoteString
- Since:
- 3.0
- See Also:
SQLFilter.formatLiteral(java.lang.String, java.lang.Class)
-
getMinInClauseSize
public int getMinInClauseSize()
Returns the minimum number of values for creating a SQL IN-clause. For fewer values, each value will have its own condition.- Returns:
- minimum IN clause size
- Since:
- 3.0
-
setMinInClauseSize
public void setMinInClauseSize(int i)
Sets the minimum number of values for creating a SQL IN-clause. For fewer values, each value will have its own condition.- Parameters:
i
- minimum IN clause size- Since:
- 3.0
-
getMaxInClauseSize
public int getMaxInClauseSize()
Returns the maximum size of an SQL IN-clause. Larger lists are split into several clauses that are OR:ed together.- Returns:
- maximum IN clause size
- Since:
- 3.0
-
setMaxInClauseSize
public void setMaxInClauseSize(int i)
Size the maximum size of an SQL IN-clause. Larger lists are split into several clauses that are OR:ed together.- Parameters:
i
- maximum IN clause size- Since:
- 3.0
-
getConditionListThreshold
public int getConditionListThreshold()
Return the condition list threshold. A temporary table is used when executing an SQL query, where total size of a condition list is larger than this threshold value.- Returns:
- a condition list threshold value
- Since:
- 3.0
-
setConditionListThreshold
public void setConditionListThreshold(int i)
Sets the condition list threshold. A temporary table is used when executing an SQL query, where total size of a condition list is larger than this threshold value.- Parameters:
i
- a condition list threshold value- Since:
- 3.0
-
getExpandInClause
public boolean getExpandInClause()
Tells if an SQL IN-clause shall be expanded into OR conditions.- Returns:
true
if IN-clauses shall be expanded,false
otherwise- Since:
- 3.0
-
setExpandInClause
public void setExpandInClause(boolean b)
Sets if an SQL IN-clause shall be expanded into OR conditions.- Parameters:
b
-true
if IN-clauses shall be expanded,false
otherwise- Since:
- 3.0
-
getTableExpressionPattern
public String getTableExpressionPattern()
Return the pattern that determines how a table expression is written in the SQL query.The following tags are used as placeholders for the catalog, schema and table name:
$$catalog$$
,$$schema$$
and$$table$$
.Optional parts are surrounded by brackets (
[
and]
).- Returns:
- a table expression pattern
String
- Since:
- 3.0
- See Also:
SQLFilter.formatTable(java.lang.String, java.lang.String, java.lang.String)
-
setTableExpressionPattern
public void setTableExpressionPattern(String s)
Sets the pattern that determines how a table expression is written in the SQL query.The following tags are used as placeholders for the catalog, schema and table name:
$$catalog$$
,$$schema$$
and$$table$$
.Optional parts are surrounded by brackets (
[
and]
).- Parameters:
s
- a table expression patternString
- Since:
- 3.0
- See Also:
SQLFilter.formatTable(java.lang.String, java.lang.String, java.lang.String)
-
getProcedureExpressionPattern
public String getProcedureExpressionPattern()
Return the pattern that determines how a procedure expression is written in the SQL query.The following tags are used as placeholders for the catalog, schema and procedure name:
$$catalog$$
,$$schema$$
and$$procedure$$
.Optional parts are surrounded by brackets (
[
and]
).- Returns:
- a procedure expression pattern
String
- Since:
- 3.0
- See Also:
SQLFilter.formatProcedure(java.lang.String, java.lang.String, java.lang.String)
-
setProcedureExpressionPattern
public void setProcedureExpressionPattern(String s)
Sets the pattern that determines how a procedure expression is written in the SQL query.The following tags are used as placeholders for the catalog, schema and table name:
$$catalog$$
,$$schema$$
and$$procedure$$
.Optional parts are surrounded by brackets (
[
and]
).- Parameters:
s
- a procedure expression patternString
- Since:
- 3.0
- See Also:
SQLFilter.formatProcedure(java.lang.String, java.lang.String, java.lang.String)
-
getDateFormatExpression
public String getDateFormatExpression()
Returns an expression that converts a date field to a string value on the format:"YYYY-MM-DD", e.g. "2002-11-19".The expression contains a
$$value$$
tag that is a placeholder for a date field.- Returns:
- an expression
String
- Since:
- 3.0
- See Also:
SQLFilter.formatConditionExpression(java.lang.String, java.lang.Class)
-
setDateFormatExpression
public void setDateFormatExpression(String s)
Sets an expression that converts a date field to a string value on the format:"YYYY-MM-DD", e.g. "2002-11-19".The expression must contain a
$$value$$
tag that is a placeholder for a date field.- Parameters:
s
- an expressionString
- Since:
- 3.0
- See Also:
SQLFilter.formatConditionExpression(java.lang.String, java.lang.Class)
-
getTimeFormatExpression
public String getTimeFormatExpression()
Returns an expression that converts a time field to a string value on the format:"HH:MM:SS", e.g. "14:59:00".The expression contains a
$$value$$
tag that is a placeholder for a date field.- Returns:
- an expression
String
- Since:
- 3.0
- See Also:
SQLFilter.formatConditionExpression(java.lang.String, java.lang.Class)
-
setTimeFormatExpression
public void setTimeFormatExpression(String s)
Sets an expression that converts a time field to a string value on the format:"HH:MM:SS", e.g. "14:59:00".The expression must contain a
$$value$$
tag that is a placeholder for a date field.- Parameters:
s
- an expressionString
- Since:
- 3.0
- See Also:
SQLFilter.formatConditionExpression(java.lang.String, java.lang.Class)
-
getDateTimeFormatExpression
public String getDateTimeFormatExpression()
Returns an expression that converts a datetime field to string value on the format: "YYYY-MM-DD HH:MM:SS", e.g. "2002-11-19 14:59:00".The expression contains a
$$value$$
tag that is a placeholder for a date field.- Returns:
- an expression
String
- Since:
- 3.0
- See Also:
SQLFilter.formatConditionExpression(java.lang.String, java.lang.Class)
-
setDateTimeFormatExpression
public void setDateTimeFormatExpression(String s)
Sets an expression that converts a datetime field to string value on the format: "YYYY-MM-DD HH:MM:SS", e.g. "2002-11-19 14:59:00".The expression must contain a
$$value$$
tag that is a placeholder for a date field.- Parameters:
s
- an expressionString
- Since:
- 3.0
- See Also:
SQLFilter.formatConditionExpression(java.lang.String, java.lang.Class)
-
getDateLiteralFormatExpression
public String getDateLiteralFormatExpression()
Returns an expression that converts a date literal to a database date value. The date literal is on the format "YYYY-MM-DD", e.g. "2002-11-19".The expression contains a
$$value$$
tag that is a placeholder for a date literal.- Returns:
- an expression
String
- Since:
- 3.0
- See Also:
SQLFilter.formatLiteral(java.lang.String, java.lang.Class)
-
setDateLiteralFormatExpression
public void setDateLiteralFormatExpression(String s)
Sets an expression that converts a date literal to a database date value. The date literal is on the format: "YYYY-MM-DD", e.g. "2002-11-19".The expression must contain a
$$value$$
tag that is a placeholder for a date literal.- Parameters:
s
- an expressionString
- Since:
- 3.0
- See Also:
SQLFilter.formatLiteral(java.lang.String, java.lang.Class)
-
getTimeLiteralFormatExpression
public String getTimeLiteralFormatExpression()
Returns an expression that converts a time literal to a database time value. The time literal is on the format:"HH:MM:SS", e.g. "14:59:00".The expression contains a
$$value$$
tag that is a placeholder for a date literal.- Returns:
- an expression
String
- Since:
- 3.0
- See Also:
SQLFilter.formatLiteral(java.lang.String, java.lang.Class)
-
setTimeLiteralFormatExpression
public void setTimeLiteralFormatExpression(String s)
Sets an expression that converts a time literal to a database time value. The time literal is on the format:"HH:MM:SS", e.g. "14:59:00".The expression must contain a
$$value$$
tag that is a placeholder for a date literal.- Parameters:
s
- an expressionString
- Since:
- 3.0
- See Also:
SQLFilter.formatLiteral(java.lang.String, java.lang.Class)
-
getDateTimeLiteralFormatExpression
public String getDateTimeLiteralFormatExpression()
Returns an expression that converts a datetime literal to a database datetime value. The datetime literal is on the format: "YYYY-MM-DD HH:MM:SS", e.g. "2002-11-19 14:59:00".The expression contains a
$$value$$
tag that is a placeholder for a date literal.- Returns:
- an expression
String
- Since:
- 3.0
- See Also:
SQLFilter.formatLiteral(java.lang.String, java.lang.Class)
-
setDateTimeLiteralFormatExpression
public void setDateTimeLiteralFormatExpression(String s)
Sets an expression that converts a datetime literal to a database datetime value. The datetime literal is on the format: "YYYY-MM-DD HH:MM:SS", e.g. "2002-11-19 14:59:00".The expression must contain a
$$value$$
tag that is a placeholder for a date literal.- Parameters:
s
- an expressionString
- Since:
- 3.0
- See Also:
SQLFilter.formatLiteral(java.lang.String, java.lang.Class)
-
getSQLType
public String getSQLType(Class javaType)
Returns the SQL type for a given Java type.- Parameters:
javaType
- a Java type- Returns:
- a SQL type
- Since:
- 3.0
- See Also:
SQLFilter.getSQLType(java.lang.Class, int)
,JDBCTypeSettings.TypeMapping
-
getSQLType
public String getSQLType(Class javaType, int length)
Returns the SQL type for a given Java type. If a positive length argument is specified, the method returns the type mapping with the smallest max-length that is larger than length. If a zero-length is specified, the method returns the first type-mapping in the list where max-length = -1, or if there is no such type-mapping with max-length = -1, then it returns the type mapping with largest max-length.- Parameters:
javaType
- a Java typelength
- the length whentype
isString
- Returns:
- a SQL type
- Since:
- 3.0
- See Also:
SQLFilter.getSQLType(java.lang.Class, int)
,JDBCTypeSettings.TypeMapping
-
getTypeMappings
public JDBCTypeSettings.TypeMapping[] getTypeMappings()
Returns all Java to SQL type mappings.- Returns:
- a
TypeMapping
array - Since:
- 3.0
- See Also:
getSQLType(Class)
-
setTypeMappings
public void setTypeMappings(JDBCTypeSettings.TypeMapping[] t)
Sets all Java to SQL type mappings.- Parameters:
t
- aTypeMapping
array- Since:
- 3.0
- See Also:
getSQLType(Class)
-
setAlwaysUsePreparedStatement
public void setAlwaysUsePreparedStatement(boolean alwaysUsePreparedStatement)
Indicates if prepared statement should be used even when no parameters are set.- Parameters:
alwaysUsePreparedStatement
- the alwaysUsePreparedStatement to set- Since:
- 3.0
-
getAlwaysUsePreparedStatement
public boolean getAlwaysUsePreparedStatement()
Indicates if prepared statement should be used even when no parameters are set.- Returns:
- true if prepared statement should be used, false if not.
- Since:
- 3.0
-
addTypeMapping
public void addTypeMapping(JDBCTypeSettings.TypeMapping t)
Add a Java to SQL type mapping.- Parameters:
t
- aTypeMapping
object- Since:
- 3.0
- See Also:
getSQLType(Class)
-
getSQLAggregateFuntion
public String getSQLAggregateFuntion(String datAggregateFuntion)
Get the SQL aggregate function for the given DAT aggregate function, or null if no such SQL function exists.- Parameters:
datAggregateFuntion
- a DAT aggregate function.- Returns:
- an SQL aggregate function.
- Since:
- 3.0
-
getTempTableNamePattern
public String getTempTableNamePattern()
Returns the pattern used to format a temporary table name in an SQL command.The name is represented by the tag
$$name$$
.- Returns:
- a table name pattern
String
- Since:
- 3.0
- See Also:
SQLFilter.formatCreateTableSQL(java.lang.String, java.lang.String[], java.lang.String[])
-
setTempTableNamePattern
public void setTempTableNamePattern(String p)
Sets the pattern used to format a temporary table name in an SQL command.The name is represented by the tag
$$name$$
.- Parameters:
p
- a table name patternString
- Since:
- 3.0
- See Also:
SQLFilter.formatCreateTableSQL(java.lang.String, java.lang.String[], java.lang.String[])
-
getCreateTempTableCommands
public String[] getCreateTempTableCommands()
Returns the SQL commands needed for creating a temporary table that is used to store filter values (when more than 'condition-list-threshold') and to store result from subqueries.The
$$name$$
tag is a placeholder for the table name. The$$column_list$$
tag is a placeholder for a column list on the format "(name type, name type, ...)"- Returns:
- a command
String
array - Since:
- 3.0
- See Also:
SQLFilter.formatCreateTableSQL(java.lang.String, java.lang.String[], java.lang.String[])
,SQLFilter.formatColumnList(java.lang.String[], java.lang.String[])
-
setCreateTempTableCommands
public void setCreateTempTableCommands(String[] s)
Sets the SQL commands needed for creating a temporary table that is used to store filter values (when more than 'condition-list-threshold') and to store result from subqueries.The
$$name$$
tag is a placeholder for the table name. The$$column_list$$
tag is a placeholder for a column list on the format "(name type, name type, ...)"- Parameters:
s
- a commandString
array- Since:
- 3.0
- See Also:
SQLFilter.formatCreateTableSQL(java.lang.String, java.lang.String[], java.lang.String[])
,SQLFilter.formatColumnList(java.lang.String[], java.lang.String[])
-
getDropTempTableCommands
public String[] getDropTempTableCommands()
Returns the SQL commands for deleting a temporary table.The
$$name$$
tag is a placeholder for the table name.- Returns:
- a command
String
array - Since:
- 3.0
- See Also:
SQLFilter.formatDropTableSQL(java.lang.String)
-
setDropTempTableCommands
public void setDropTempTableCommands(String[] s)
Sets the SQL commands for deleting a temporary table.The
$$name$$
tag is a placeholder for the table name.- Parameters:
s
- a commandString
array- Since:
- 3.0
- See Also:
SQLFilter.formatDropTableSQL(java.lang.String)
-
getLobThreshold
public int getLobThreshold()
Returns the threshold value when LOB values used as parameters in a WHERE clause, must be written in temporary tables.- Returns:
- a threshold value, -1 means no limit
- Since:
- 3.0
-
setLobThreshold
public void setLobThreshold(int i)
Sets the threshold value when LOB values used as parameters in a WHERE clause, must be written in temporary tables.- Parameters:
i
- a threshold value, -1 means no limit- Since:
- 3.0
-
isAnsiiStyleOuterJoin
public boolean isAnsiiStyleOuterJoin()
Returns if an attempt should be done to go from oracle outer join syntax with '(+)' to ANSI form If useAnsiJoin() is true, then this setting has no effect.- Returns:
- if we should rewrite
- Since:
- 3.0
-
setAnsiiStyleOuterJoin
public void setAnsiiStyleOuterJoin(boolean outerJoin)
Set if an attempt should be done to go from oracle outer join syntax with '(+)' to ANSI form If useAnsiJoin() is true, then this setting has no effect.- Parameters:
outerJoin
- if rewrite should take place- Since:
- 3.0
-
isAnsiJoin
public boolean isAnsiJoin()
Returns if an attempt should be made to create ansi join syntax.- Returns:
- true if attempts should be made to create ansi join syntax, false if not.
- Since:
- 7.5
-
setAnsiJoin
public void setAnsiJoin(boolean useAnsiJoin)
Set if an attempt should be made to create ansi join syntax.- Parameters:
useAnsiJoin
- if set to true attempts should be made to create ansi join syntax, if false no attempt to rewrite inner joins will be made and outer joins depend on value for isAnsiiStyleOuterJoin().- Since:
- 7.5
-
getConnectionProperties
public Properties getConnectionProperties()
Returns the connection properties used when creating a new connection to the database.- Returns:
- a
Properties
value - Since:
- 3.0
-
setConnectionProperties
public void setConnectionProperties(Properties connectionProperties)
Sets the connection properties used when creating a new connection to the database.- Parameters:
connectionProperties
- the connection properties- Since:
- 3.0
-
getCredentialsTimeout
public int getCredentialsTimeout()
Gets the credentials timeout for a JDBC data source. The timeout is given in seconds.- Returns:
- the credentials timeout, in seconds, for a JDBC data source.
- Since:
- 3.2
-
setCredentialsTimeout
public void setCredentialsTimeout(int credentialsTimeout)
Sets the credentials timeout for a JDBC data source. The timeout is stated in seconds.- Parameters:
credentialsTimeout
- the credentials timeout, in seconds, for a JDBC data source- Since:
- 3.2
-
setAutocommit
public void setAutocommit(boolean autocommit)
Sets the auto commit mode for connection on the data source.- Parameters:
autocommit
- false means autocommit is not set, true means autocommit is set if supported.- Since:
- 3.2
-
getAutocommit
public boolean getAutocommit()
Get autocommit mode.- Returns:
- true if autocommit mode is set, false otherwise.
- Since:
- 3.2
-
-