Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: How to create an array of Map<String, Object>

  1. #1
    Junior Member
    Join Date
    Feb 2013
    Thanked 0 Times in 0 Posts

    Default How to create an array of Map<String, Object>

    I would like to use simpleJdbcInsert class and executeBatch method

    public int[] executeBatch(Map<String,Object>[] batch)

    So I need to pass an array of Map<String,Object> as paramter. How to create such an array?
    What I tried is
    Map<String, Object>[] myArray = new HashMap<String, Object>[10]

    It is error: Cannot create generic array of Map<String, Object>

    So how to create an array of Map<String, Object> ?

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Eastern Florida
    Thanked 2,429 Times in 2,380 Posts

    Default Re: How to create an array of Map<String, Object>

    Also posted at how to create an array of maps
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. [SOLVED] Sorting an object array using string variables from a string array
    By Shadud in forum What's Wrong With My Code?
    Replies: 0
    Last Post: November 26th, 2012, 05:50 PM
  2. how to sort array by object string member value?
    By amgleason83 in forum Collections and Generics
    Replies: 9
    Last Post: March 16th, 2012, 05:29 PM
  3. private Map<String, ArrayList> xlist = new HashMap<String, ArrayList>();
    By Scotty in forum What's Wrong With My Code?
    Replies: 1
    Last Post: March 21st, 2011, 08:37 AM
  4. Create a CLOB object with the string value
    By oshoarun in forum JDBC & Databases
    Replies: 0
    Last Post: March 6th, 2010, 02:54 AM
  5. Replies: 2
    Last Post: February 25th, 2010, 04:17 PM