This method of the Connection class assigns how long to wait for a command to execute.
public void setConnectionTimeout(int timeout);