public static Timestamp getCurrentTimeFromDB ( ) throws EFapsException { Timestamp now = null ; final ConnectionResource rsrc = Context . getThreadContext ( ) . getConnectionResource ( ) ; final Statement stmt ; try { stmt = rsrc . createStatement ( ) ; final ResultSet resultset = stmt . executeQuery ( "SELECT " + Context . getDbType ( ) . getCurrentTimeStamp ( ) ) ; resultset . next ( ) ; now = resultset . getTimestamp ( 1 ) ; resultset . close ( ) ; stmt . close ( ) ; } catch ( final SQLException e ) { DateTimeUtil . LOG . error ( "could not execute SQL-Statement" , e ) ; } return now ; }
Static method to get the current time stamp from the eFaps database .