Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Returning multiple Database rows from a web service  RSS feed

 
Debojit Sinha
Ranch Hand
Posts: 66
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm attempting to return multiple rows fetched from a database table via a web service, but it seems that JAXB can't handle ArrayList. In that case, how do I got about returning multiple rows from a database?
 
Kumar Raja
Ranch Hand
Posts: 548
2
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Debojit Sinha wrote:Hi,
I'm attempting to return multiple rows fetched from a database table via a web service, but it seems that JAXB can't handle ArrayList. In that case, how do I got about returning multiple rows from a database?


JAXB supports arrays and you can convert ArrayList to Arrays using API
 
Debojit Sinha
Ranch Hand
Posts: 66
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would this work with arrays of Objects as well? The objects are all javabeans.
 
Kumar Raja
Ranch Hand
Posts: 548
2
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Debojit Sinha wrote:Would this work with arrays of Objects as well? The objects are all javabeans.


Yes, as long as are JAXB compatible.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!