Example usage for org.apache.commons.dbcp2.managed BasicManagedDataSource setValidationQuery

List of usage examples for org.apache.commons.dbcp2.managed BasicManagedDataSource setValidationQuery

Introduction

In this page you can find the example usage for org.apache.commons.dbcp2.managed BasicManagedDataSource setValidationQuery.

Prototype

public void setValidationQuery(String validationQuery) 

Source Link

Document

Sets the #validationQuery .

Note: this method currently has no effect once the pool has been initialized.

Usage

From source file:org.everit.blobstore.jdbc.test.JtdsJdbcBlobstoreTest.java

@Override
protected BasicManagedDataSource createManagedDataSource(final GeronimoTransactionManager transactionManager,
        final XADataSource xaDataSource) {

    BasicManagedDataSource lManagedDataSource = super.createManagedDataSource(transactionManager, xaDataSource);
    lManagedDataSource.setValidationQuery("select 1");
    return lManagedDataSource;
}