Logo Search packages:      
Sourcecode: mysql-connector-java version File versions

long com::mysql::jdbc::Connection::getIdleFor (  )  [inline]

NOT JDBC-Compliant, but clients can use this method to determine how long this connection has been idle. This time (reported in milliseconds) is updated once a query has completed.

Returns:
number of ms that this connection has been idle, 0 if the driver is busy retrieving results.

Definition at line 644 of file Connection.java.

References lastQueryFinishedTime.

                             {
        if (this.lastQueryFinishedTime == 0) {
            return 0;
        }
            
        long now = System.currentTimeMillis();          
        long idleTime = now - this.lastQueryFinishedTime;
  
        return idleTime;
    }


Generated by  Doxygen 1.6.0   Back to index