Results 1 to 3 of 3

Thread: directly populating a JCombobox with an IBATIS resultmap

  1. #1
    Join Date
    Jun 2005
    Location
    Rouen
    Posts
    4

    Default directly populating a JCombobox with an IBATIS resultmap

    hi,

    this topic is between Ibatis and RCP. but i choose to post it there.

    i'm trying to populate a Jcombobox directly with the result of an Ibatis statment.
    the Jcombobox accept only a vector or an array of objects as argument
    not Map or HashMap.
    on the other side , Ibatis accept only bean or map

    is somebody have an idea ?

    thanks


    David

  2. #2
    Join Date
    Feb 2005
    Location
    Boston, MA
    Posts
    1,142

    Default

    This is entirely doable. You can create a iBatis based DAO object which returns a List (which is a super-interface of a Collection, which a vector can be initialized with)

    Code:
    public class MyDAOSqlMapClient extends SqlMapClientDaoSupport {
    	List getComboList(final String param) {
    		return getSqlMapClientTemplate().queryForList("mystatement", param);
    	}
    }
    And you initialize the JComboBox like so:

    Code:
    JComboBox combo = new JComboBox(new Vector(dao.getComboList("comboName")));

  3. #3
    Join Date
    Jun 2005
    Location
    Rouen
    Posts
    4

    Default

    thanks a lot

Similar Threads

  1. Replies: 3
    Last Post: Sep 22nd, 2005, 05:54 PM
  2. iBatis lazy load transaction issues.
    By efpiva in forum Data
    Replies: 3
    Last Post: Jun 22nd, 2005, 06:20 PM
  3. Utilize Spring's JDBC Framework or iBATIS
    By jaybytez in forum Data
    Replies: 2
    Last Post: Mar 11th, 2005, 06:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •