-
1. Re: Using Teiid JDBC client driver with Teiid Embedded
ichanjasper Oct 31, 2016 7:08 PM (in response to ichanjasper)I found this piece of code to accept remote JDBC connection requests:
EmbeddedServer es =
new
EmbeddedServer()
SocketConfiguration s =
new
SocketConfiguration();
s.setBindAddress(
"<host-name>"
);
s.setPortNumber(
35432
);
s.setProtocol(WireProtocol.pg);
EmbeddedConfiguration config =
new
EmbeddedConfiguration();
config.addTransport(s);
es.start(config);
Does this transport feature work with Teiid JDBC client driver?
-
2. Re: Using Teiid JDBC client driver with Teiid Embedded
rareddy Oct 31, 2016 7:37 PM (in response to ichanjasper)Yes, you are on right path. You can open both JDBC and ODBC transports with socket configuration if you need *remote* access. Here is example of it teiid-embedded-examples/embedded-portfolio-sockets at master · teiid/teiid-embedded-examples · GitHub
Once ou have configured, you can use JDBC client, just like you do for the server.
-
3. Re: Using Teiid JDBC client driver with Teiid Embedded
ichanjasper Oct 31, 2016 7:50 PM (in response to rareddy)Thank you!
-
4. Re: Using Teiid JDBC client driver with Teiid Embedded
ichanjasper Nov 4, 2016 6:25 PM (in response to ichanjasper)Hi Ramesh,
I got my server to work with Teiid JDBC client driver. However, is it possible to pass in extra property in JDBC url? If so, which function I will need to overwrite in EmbeddedServer to retrieve this extra property value which get passed it from client? And how is the syntax for JDBC url?
For example:
I have URL like the following:
jdbc:teiid:1279084383@mm://localhost:31000;param1=value1
And I want to use the value of param1 to generate the correct VDB name in server side. Because of our client app doesn't know VDB name.
Thanks,
Ivan
-
5. Re: Using Teiid JDBC client driver with Teiid Embedded
rareddy Nov 4, 2016 7:45 PM (in response to ichanjasper)You can send custom payload through "SET PAYLOAD ..." see SET Statement · Teiid Documentation
However, that can never be used to rename a VDB. Once the parameter is set, these can be accessed in custom translator. Instead explain your usecase there may be a different solution.
Ramesh..
-
6. Re: Using Teiid JDBC client driver with Teiid Embedded
ichanjasper Nov 7, 2016 5:10 PM (in response to rareddy)Let me explain our usecase.
We have code in the server side to build VDB schema on the fly and pass it to Teiid Embedded server. And we want to combine this with Teiid client JDBC driver.
1. User will use Teiid client JDBC driver to access VDB
2. Server side: If VDB doesn't exist in Teiid Embedded server, our server will generate new VDB and store it to Teiid Embedded Server. Before passing to Teiid engine.
3. Return existing or new VDB jdbc connection back to client through the driver
Therefore, we are looking for a place to build a wrapper on top of Teiid Embedded server which before passing VDB name into Teiid engine. Therefore, our engine can check whether we need to build VDB on the fly first.
Thanks,
Ivan
-
7. Re: Using Teiid JDBC client driver with Teiid Embedded
rareddy Nov 7, 2016 10:35 PM (in response to ichanjasper)What you wanting to do is currently not possible, however we have been working towards solution like that in - JBoss Issue Tracker Using this, you can issue DDL statements through the JDBC client and build the VDB. However, there are few loose ends we are still trying to figure out. The implementation so far is at branch GitHub - teiid/teiid at TEIID-2578 we hope get initial commit done on 9.2 development cycle, so if you want to participate and provide feed back that would be great. You can build Teiid from above branch and test it out.
Ramesh..
-
8. Re: Using Teiid JDBC client driver with Teiid Embedded
ichanjasper Nov 8, 2016 1:06 PM (in response to rareddy)Hi Ramesh,
I see. I will love to participate and provide feedback. Would you mind to tell me the name of the listener class which listens and processes JDBC URL inside Teiid Embedded server?
-
9. Re: Using Teiid JDBC client driver with Teiid Embedded
rareddy Nov 9, 2016 12:54 AM (in response to ichanjasper)There is no listener class. You need to supply vdbEdit=true URL property to create a VDB. The server mode example here teiid/IntegrationTestDDL.java at TEIID-2578 · teiid/teiid · GitHub
Similar without data sources will work for embedded. There is documentation forth coming.