Class AutodetectJdbcCustomization
- java.lang.Object
-
- com.github.kagkarlsson.scheduler.jdbc.AutodetectJdbcCustomization
-
- All Implemented Interfaces:
JdbcCustomization
public class AutodetectJdbcCustomization extends Object implements JdbcCustomization
-
-
Field Summary
Fields Modifier and Type Field Description static StringMARIADBstatic StringMICROSOFT_SQL_SERVERstatic StringMYSQLstatic StringORACLEstatic StringPOSTGRESQL
-
Constructor Summary
Constructors Constructor Description AutodetectJdbcCustomization(DataSource dataSource)AutodetectJdbcCustomization(DataSource dataSource, boolean persistTimestampInUTC)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringcreateGenericSelectForUpdateQuery(String tableName, int limit, String requiredAndCondition, boolean orderByPriority)StringcreateSelectDueQuery(String tableName, int limit, String andCondition, boolean orderByPriority)InstantgetInstant(ResultSet rs, String columnName)StringgetName()StringgetQueryLimitPart(int limit)byte[]getTaskData(ResultSet rs, String columnName)List<Execution>lockAndFetchSingleStatement(JdbcTaskRepositoryContext ctx, Instant now, int limit, boolean orderByPriority)voidsetInstant(PreparedStatement p, int index, Instant value)voidsetTaskData(PreparedStatement p, int index, byte[] value)booleansupportsExplicitQueryLimitPart()booleansupportsGenericLockAndFetch()booleansupportsSingleStatementLockAndFetch()
-
-
-
Field Detail
-
MICROSOFT_SQL_SERVER
public static final String MICROSOFT_SQL_SERVER
- See Also:
- Constant Field Values
-
POSTGRESQL
public static final String POSTGRESQL
- See Also:
- Constant Field Values
-
ORACLE
public static final String ORACLE
- See Also:
- Constant Field Values
-
MYSQL
public static final String MYSQL
- See Also:
- Constant Field Values
-
MARIADB
public static final String MARIADB
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AutodetectJdbcCustomization
public AutodetectJdbcCustomization(DataSource dataSource)
-
AutodetectJdbcCustomization
public AutodetectJdbcCustomization(DataSource dataSource, boolean persistTimestampInUTC)
-
-
Method Detail
-
setInstant
public void setInstant(PreparedStatement p, int index, Instant value) throws SQLException
- Specified by:
setInstantin interfaceJdbcCustomization- Throws:
SQLException
-
getInstant
public Instant getInstant(ResultSet rs, String columnName) throws SQLException
- Specified by:
getInstantin interfaceJdbcCustomization- Throws:
SQLException
-
setTaskData
public void setTaskData(PreparedStatement p, int index, byte[] value) throws SQLException
- Specified by:
setTaskDatain interfaceJdbcCustomization- Throws:
SQLException
-
getTaskData
public byte[] getTaskData(ResultSet rs, String columnName) throws SQLException
- Specified by:
getTaskDatain interfaceJdbcCustomization- Throws:
SQLException
-
supportsExplicitQueryLimitPart
public boolean supportsExplicitQueryLimitPart()
- Specified by:
supportsExplicitQueryLimitPartin interfaceJdbcCustomization
-
getQueryLimitPart
public String getQueryLimitPart(int limit)
- Specified by:
getQueryLimitPartin interfaceJdbcCustomization
-
supportsSingleStatementLockAndFetch
public boolean supportsSingleStatementLockAndFetch()
- Specified by:
supportsSingleStatementLockAndFetchin interfaceJdbcCustomization
-
lockAndFetchSingleStatement
public List<Execution> lockAndFetchSingleStatement(JdbcTaskRepositoryContext ctx, Instant now, int limit, boolean orderByPriority)
- Specified by:
lockAndFetchSingleStatementin interfaceJdbcCustomization
-
supportsGenericLockAndFetch
public boolean supportsGenericLockAndFetch()
- Specified by:
supportsGenericLockAndFetchin interfaceJdbcCustomization
-
createGenericSelectForUpdateQuery
public String createGenericSelectForUpdateQuery(String tableName, int limit, String requiredAndCondition, boolean orderByPriority)
- Specified by:
createGenericSelectForUpdateQueryin interfaceJdbcCustomization
-
createSelectDueQuery
public String createSelectDueQuery(String tableName, int limit, String andCondition, boolean orderByPriority)
- Specified by:
createSelectDueQueryin interfaceJdbcCustomization
-
getName
public String getName()
- Specified by:
getNamein interfaceJdbcCustomization
-
-