<P> Since Java EE 6 a JNDI - bound DataSource can alternatively be configured in a declarative way directly from within the application . This alternative is particularly useful for self - sufficient applications or for transparently using an embedded database . </P> <P> A DataSource is an abstract representation of a live set of data that presents a common predictable API for other objects to interact with . The nature of your data, its quantity, its complexity, and the logic for returning query results all play a role in determining your type of DataSource . For small amounts of simple textual data, a JavaScript array is a good choice . If your data has a small footprint but requires a simple computational or transformational filter before being displayed, a JavaScript function may be the right approach . For very large datasets--for example, a robust relational database--or to access a third - party webservice you'll certainly need to leverage the power of a Script Node or XHR DataSource . </P>

What is the use of datasource in java