JBoss.orgCommunity Documentation

Appendix A. Frequently Asked Questions

A.1. Are there any pre-built scripts available?
A.2. I have written a very useful script to do XYZ, I would like this to be part of the distribution?
A.3. What is different between "connect(<url>)" method and "connectAsAdmin()"?
A.4. How can I turn on the debug?
A.5. Is IDE support available for writing the scripts?
A.6. Is debugging support available?
A.7. How to turn OFF interactive mode? How can I capture results to a file?
A.1.

Are there any pre-built scripts available?

Yes, there are a few utility scripts are available in the "samples" directory with ".bsh" extension.

A.2.

I have written a very useful script to do XYZ, I would like this to be part of the distribution?

Yes, we would love to hear from users. Please submit the script to Technical Support, and if this script found to be useful and generic enough for all the customers, we will include the script in the scripts library in the following releases.

A.3.

What is different between "connect(<url>)" method and "connectAsAdmin()"?

Connect connects to the Teiid system using a VDB name, so you should be able to run any SQL command which is based on that VDB along with Admin method calls. If you use "connectAsAdmin" then you can run all the admin calls but you can not run any SQL commands, and you do not need a VDB to connect to the Teiid system.

A.4.

How can I turn on the debug?

At command prompt type

mmadmin $ debug= true;   // to turn it ON
mmadmin $ debug= false; // to turn it OFF        
        
A.5.

Is IDE support available for writing the scripts?

Full IDE support is not available, however eclipse can be used as the editor for developing the scripts. Just set the “.bsh” extension association with Java editor, so all the color syntax is available for your script.

A.6.

Is debugging support available?

No. Not for the scripts. However, if the scripts are calling into other Java code, those calls can be intercepted and can be run through debugger.

A.7.

How to turn OFF interactive mode? How can I capture results to a file?

Once you start the shell in the interactive mode, at the prompt enter the following

          bsh.interactive=false;
        

this will turn off the interactive features like spitting the results to console. This is good way to capture the results of the executed query. Use printResults(File) method to capture the previously executed SQL command's results to the file handle supplied