Previous Topic

Next Topic

Query Timeout Options

The c-treeACE 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 c-treeACE 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:6597@localhost: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);