assertj-db
assertj-db copied to clipboard
QueryTimeout
Is there a way to specify connection / query timeout while using assertj db ?
@willyhalim , Currently you have two ways to do that :
- You can use properties in JDBC connection URL with AssertJ-DB Source ( For example with Postgresl : https://jdbc.postgresql.org/documentation/head/connect.html )
- You can use settings of DataSource and use it in Table instead of Source
Tell me if it fit with your requirement.
It seems didnt work , in normal prepared statement i can do something like this
ps = conn.prepareStatement(query);
if (queryTimeout > 0) {
ps.setQueryTimeout(queryTimeout);
LOGGER.info("set querytimeout {}", queryTimeout);
}
Hi @willyhalim , can you send me some details of your issue / use case ? When the timeout error is raised ? During the connection ? During an assertj-db assertion ? Thanks.