public List < Meta > userMetadata ( final long userId , final String key ) throws SQLException { Connection conn = null ; PreparedStatement stmt = null ; ResultSet rs = null ; List < Meta > meta = Lists . newArrayListWithExpectedSize ( 16 ) ; Timer . Context ctx = metrics . userMetadataTimer . time ( ) ; try { conn = connectionSupplier . getConnection ( ) ; stmt = conn . prepareStatement ( selectUserMetaKeySQL ) ; stmt . setLong ( 1 , userId ) ; stmt . setString ( 2 , key ) ; rs = stmt . executeQuery ( ) ; while ( rs . next ( ) ) { meta . add ( new Meta ( rs . getLong ( 1 ) , rs . getString ( 2 ) , rs . getString ( 3 ) ) ) ; } return meta ; } finally { ctx . stop ( ) ; SQLUtil . closeQuietly ( conn , stmt , rs ) ; } }
Selects user metadata with a specified key .