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
Post a Comment