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