How to configure a JDBC Query Timeout for PostgreSQL?

Solution Unverified - Updated -

Issue

  • I would like to configure the query timeout for PostgreSQL. How do I configure the timeout?
  • I tried the following setting to the datasource configuration in JBoss EAP but it does not work.

        <query-timeout>60</query-timeout>
    
  • I saw the following Exception when I called Statement.setQueryTimeout(int):

    org.postgresql.util.PSQLException: Method org.postgresql.jdbc4.Jdbc4PreparedStatement.setQueryTimeout(int) is not yet implemented.
    

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 4.x
    • 5.x
    • 6.x
  • PostgreSQL JDBC Driver
    • 8.x
    • 9.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content