1. Is there any way to programatically (and automatically, not using Teiid Designer from Eclipse) create the VDB from CSV and Excel files? From creating the Teiid Metadata Model, Connection Profile, Data Source, to creating the VDB itself.
Yes, there are Java-based API's available to create a VDB. It does require a certain level of familiarity with Teiid and involved APIs. For building a plain VDB you can see an example here . For CSV and Excel it would be little different. As per creating the datasource, it depends on the deployed environment like WildFly. For example, in WildFly you can create datasource like as shown in here . Also note in  how a created VDB can be deployed from your client into Teiid/WildFly server etc.
Then again you can take a completely different direction, embed the Teiid engine into OnTop using either Teiid Embedded or Teiid Spring Boot libraries, where VDB creation is same but creating the data sources is all up to your program, and Teiid engine would require a connection object to work which you would need to configure.
2. I did all the steps at this tutorial, specifically at the "Create Data Source" part, but I can't seem to find .xml file (bookprices-file-ds.xml) for the Data Source. But, I can make it work through the end of the tutorial, including combining the CSV file to the existing VDB and querying it. Why is that?
I am not sure about that perticular guide, however since you used the Teiid Designer it will create the necessary artifacts underneath. Typically all -ds.xml files define connection configuration to either database, file, excel sources. There is an option you can directly edit the "standalone.xml" file and add the contents of the -ds.xml file or place the -ds.xml file in the server's "standalone/deploy" folder then the runtime will create the connection automatically. For sample -ds.xml files look the directory "<teiid-server>/docs/teiid/datasources"
First of all, thank you very much for your thorough response. Definitely will look into it.
I did some searching and I found out the term "Dynamic VDB" from here and here. Is that not the case anymore for creating VDB without Teiid Designer, or does the Java code that you gave me earlier practically did the same thing as creating the .xml file (for Dynamic VDB) with a program?
And from here, it said that "Starting with Teiid 8.13 there is no longer an embedded distribution. You can still should run directly from maven or your IDE". Is this still case, where embedded is not supported anymore?
Thank you very much.
Yes, the Java API I showed above do create the Dynamic VDB. A Dynamic VDB is simple XML file with embedded DDL for metadata part. There is a lot of documentation on DDL constructs that can be used, or you can define the metadata programmatically too as all of them have API behind them. Previously we did a .zip file for Embedded Bundle, we stopped that. All the JAR files are now in maven central, so as long as you can use tools like Maven or Gradle you can refer to the needed modules from their maven co-ordinates. Take look at one of the embedded examples . Note that you can use Dynamic VDBs with Teiid Server too, but note the Admin API to create the datasources is only available in Teiid Server mode, as I mentioned above in Embedded Model you are responsible for creating your own connections to sources. Teiid Spring Boot library gives the functionality somewhere in between the server and embedded mode.
I see that from  we can create the VDB programatically by using the org.teiid.adminapi.impl.VDBMetaData (please correct me if I am wrong) and from  we can deploy VDB by using the admin.deploy method, but are those two different? The first one is the programmaticaly created VDB while at the , the VDB is already exist in the form of .vdb or .xml file. How can we deploy to the Teiid Server the VDB that we created at ? Because the parameter that admin.deploy method can take is just string (a vdb file that is already created (.vdb or .xml) and the path to the file), not an instance of VDBMetaData Class like the one we define in .
Thank you very much.
You marshall the VDBMetadata object to get an XML format of the data and pass into deploy methods as the input stream. Use VDBMetadataParser class for marshall and unmarshall.
I really thank you for the answers the you've been giving me. Will definitely take a look at the VDBMetadataParser class for marshalling and unmarshalling.
I saw from the Quick Start page  that we need to create the connection to the text file data source by adding the .xml below to the "resource-adapter" subsystem at the standalone-teiid.xml configuration file :
I tried to search for the keyword org.teiid.resource.adapter.file.FileManagedConnectionFactory at the teiid/teiid repo and found this code at this Class file :
Properties props = new Properties();
AdminUtil.createDataSource(admin, "test-file", "file", props);
Are those 5 line of code that all we need to create datasource/create a connection to the text file based source? How about other metadata like "slot=main","use-java-context=true", "id=org.jboss.teiid.resource-adapter.file" and others? Do we not need to add them?
Thank you very much. All the best for the Teiid team.
The connection creation is very specific to the environment in which Teiid is being used. The XML you showed is applicable in the WildFly environments, and so is the java code. For embedded see examples here teiid-embedded-examples/embedded-portfolio at master · teiid/teiid-embedded-examples · GitHub