public static Integer max ( Connection connection , String table , String column , String where , String [ ] args ) { Integer max = null ; if ( count ( connection , table , where , args ) > 0 ) { StringBuilder maxQuery = new StringBuilder ( ) ; maxQuery . append ( "select max(" ) . append ( CoreSQLUtils . quoteWrap ( column ) ) . append ( ") from " ) . append ( CoreSQLUtils . quoteWrap ( table ) ) ; if ( where != null ) { maxQuery . append ( " where " ) . append ( where ) ; } String sql = maxQuery . toString ( ) ; max = querySingleInteger ( connection , sql , args , false ) ; } return max ; }
Get the max query result