Product Documentation

FairCom JDBC Developer's Guide

Previous Topic

Next Topic

Query Timeout Options

The FairCom DB SQL supports a timeout option for an executing query. This feature can ensure that an unintended query statement does not consume excessive processing time.

With the FairCom DB SQL JDBC Driver, use the setQueryTimeout() method of the java.sql.Statement interface as shown here.

c-treeSQL JDBC Example

Class.forName ("ctree.jdbc.ctreeDriver");

Connection myConnection = DriverManager.getConnection("jdbc:ctree://localhost:6597/ctreeSQL", "ADMIN", "ADMIN");

Statement myStatement = myConnection.createStatement();

String query = "SELECT TOP 50000 FROM my_big_table WHERE this < that AND this_string = 'that_string' ORDER BY foo"

myStatement:setQueryTimeout(5);

myStatement.executeUpdate(query);

TOCIndex