java - H2: getArray returns only one element -


i have following table:

create table "mytable" ( ...    "columns" array not null, ... ); 

i inserted elements in array manually via h2 web console:

insert "mytable"(..."columns"...) values (...,'{''col1:uuid'',''col2:id'',''col3:firstname'',''col4:middlename'',''col5:lastname''}',...); 

now try array of elements java

object[] colarray=(object[]) rs.getarray("columns").getarray(); system.out.println("test:"+colarray.length);//returns 1. columns in 1 string. 

what mistake?

to insert column type array use following syntax:

insert               "mytable"("columns")        values        (             (                'col1:uuid',                'col2:id',                'col3:firstname',                'col4:middlename',                'col5:lastname'            )        ); 

check data

select array_length("columns") "mytable" 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -