How to return a value from a inner class?

前端 未结 5 567
抹茶落季
抹茶落季 2021-01-12 18:39

My code is here:

public static boolean showConfirmationDialog(Context context, String title, String dialogContent) {
        AlertDialog.Builder builder = ne         


        
5条回答
  •  南方客
    南方客 (楼主)
    2021-01-12 19:18

    You can do follow simple step:

     create a POJO class object inside method.
     call setter method by setting return value and use it.
    

    Example:

        public void process(){
        Contact contact=new Contact();
        String selectCount="select * from firmId  where id=? for update";
       PreparedStatementCreatorFactory pscf = new 
       PreparedStatementCreatorFactory(selectCount,new int[] {Types.INTEGER});
            pscf.setUpdatableResults(true);
            pscf.setResultSetType(ResultSet.CONCUR_UPDATABLE);
            RowCallbackHandler rch = new RowCallbackHandler() {
                @Override
                public void processRow(ResultSet resultSet) throws SQLException {
    
                 // Here You can set your value
                    contact.setContactId(incrementCount);
                    resultSet.updateLong("firmCount",incrementCount);
                    resultSet.updateRow();
                    return;                                                                        
                }
              };
             return contact.getId();
           }
    

提交回复
热议问题