First, amf3 does not seem to support parsing arrays such as list. arraylist... the Java client transfers List objects, and amf3 cannot be parsed as array...
The reason is: amf3 only supports the basic data type...
Therefore, you need to convert data such as list to object []! In this way, amf3 can parse the array passed by Java into array...
Because the array is created, you need to set the length of the array even if no value is assigned at the beginning, for example, string [] mystring = new string [5];
Therefore, you need to dynamically create an object [] array. But often, length is unknown at the beginning, such as the resultset in JDBC...
@ Suppresswarnings ("unchecked") <br/> Public seed_warehouse [] findseedwarehousebyuserid (INT userid) <br/> throws sqlexception {<br/> string SQL = "select * From lesogo_seed_warehouse where user_id =? "; <Br/> dB. dopstm (SQL, new object [] {userid}); <br/> resultset rs = dB. getrs (); <br/> If (RS! = NULL) {<br/> int I = 0; // obtain the number of rows in the database table! <Br/> while (RS. next () {<br/> I ++; <br/>}< br/> seed_warehouse [] SWS = new seed_warehouse [I]; <br/> Rs. beforefirst (); // The cursor points to the starting position! <Br/> Int J = 0; <br/> while (RS. next () {<br/> seed_warehouse Sw = new seed_warehouse (); <br/> SW. setid (RS. getint (1); <br/> SW. setcrop_class_name (RS. getstring (2); <br/> SW. setcrop_count (RS. getint (3); <br/> SW. setuser_id (RS. getint (4); <br/> SWS [J ++] = Sw; // assign values to objects in the specific data location! <Br/>}< br/> return SWS; <br/>}< br/> return NULL; <br/>}
Summary:
I have to seriously study the amf3 protocol...