Once you deployed your VDB, you can use Java program to access using the JDBC, and example here Connecting to Teiid - SimpleClient Example - Teiid Examples - Project Documentation Editor
Or you can use tools like SquirreL Or ODBC Query Tool to connect and issue the query I mentioned above.
Yes, you can wrap the query in a virtual stored procedure and execute that.