How To connect Tibco ActiveSpaces and retrieve data from tuples in Java

Recently we automated the database testing. The database is Tibco ActiveSpaces. They dont call it a database it is called as metaspace in Activepaces. They have different names for common database related names, such as:
Database : Metaspace
Table : Space
Row : Tuple
Database query : Filter



The below code will show you how to connect to Tibco ActiveSpaces and how to fetch tuple values from the spaces.