-
1. Re: Oracle Proxy Session and Teiid
rareddy Mar 25, 2010 12:54 PM (in response to andeeptoor)Andeep,
We do support a feature called user specific pools at the connectors. Take a look at http://docs.jboss.org/teiid/6.2/reference/en-US/html/connectors.html#d0e8114
The above will satisfy (3) from your list. If you like (2) then see section 8.2.4
Word of caution about 7.0 final release, this way to handle the connector's connection pool to the data source is changing. Teiid will be deployed inside the JBoss AS as runtime and eiid managed connection pools will be replaced with JBoss managed connection pools. If JBoss AS's data source connection pooling will support identity switching on already created connection, then Teiid will also support it. Other wise that scenario needs to be further investigated. I have not done my investigation yet.
Hope this helps.
Ramesh..
-
2. Re: Oracle Proxy Session and Teiid
andeeptoor Mar 25, 2010 2:57 PM (in response to rareddy)Ramesh,
Thanks for your reply. I attempted to use the credentials property, as the link you sent me showed, but I received an error:
java.sql.SQLException: java.lang.IllegalArgumentExceptionat org.teiid.jdbc.EmbeddedProfile.parseURL(EmbeddedProfile.java:229)at org.teiid.jdbc.EmbeddedProfile.connect(EmbeddedProfile.java:108)at org.teiid.jdbc.TeiidDriver.connect(TeiidDriver.java:92)at java.sql.DriverManager.getConnection(DriverManager.java:582)at java.sql.DriverManager.getConnection(DriverManager.java:185)...Caused by: java.lang.IllegalArgumentExceptionat com.metamatrix.jdbc.util.MMJDBCURL.parseConnectionProperty(MMJDBCURL.java:196)at com.metamatrix.jdbc.util.MMJDBCURL.parseConnectionPart(MMJDBCURL.java:166)at com.metamatrix.jdbc.util.MMJDBCURL.parseURL(MMJDBCURL.java:134)at com.metamatrix.jdbc.util.MMJDBCURL.<init>(MMJDBCURL.java:76)at org.teiid.jdbc.EmbeddedProfile.parseURL(EmbeddedProfile.java:194)... 27 moreThe code I am using to connect is
Class.forName("org.teiid.jdbc.TeiidDriver");
String credentials = "credentials=(system=mySys,user=foo,password=bar);";
String url = "jdbc:teiid:FOO@/opt/teiid-7.0.0-SNAPSHOT/deploy.properties;txnAutoWrap=PESSIMISTIC;" + credentials;
Connection connection = DriverManager.getConnection(url, "admin", "teiid");
Is there some sort of mismatch between the example for version 6.2 (the version of the doc you sent me) and the version that I am using (7.0.0-SNAPSHOT...really, 7.0.0-M2)? If so, do you have an updated example? Digging into the code, it seems like the MMJDBCURL class throws an exception because it does not like the fact that there is a property (credentials) that has an "=" in its value.
Again, this would be to satisfy (3) from my original post. For trying to accomplish (2), you pointed out section 8.2.4. Could you explain the following:
For JDBC connectors, the extension connection factory class name must be set for user instead of single identity.
For example the Oracle JDBC connector would use
com.metamatrix.connector.jdbc.oracle.OracleUserIdentityConnectionFactory
Where does the com.metamatrix.connector.jdbc.oracle.OracleUserIdentityConnectionFactory class come from? Where can I find the source for this class? Am I supposed to extend this class? If so, how do I get Teiid to use the new class that I create?
-
3. Re: Oracle Proxy Session and Teiid
rareddy Mar 25, 2010 3:43 PM (in response to andeeptoor)Please try
Class.forName("org.teiid.jdbc.TeiidDriver"); String credentials = "credentials="+URLEncode.encode("(system=mySys,user=foo,password=bar)"); String url = "jdbc:teiid:FOO@/opt/teiid-7.0.0-SNAPSHOT/deploy.properties;txnAutoWrap=PESSIMISTIC;" + credentials; Connection connection = DriverManager.getConnection(url, "admin", "teiid")
Docs are not up to date with 7.0 M2, and I do not think they will be until 7.0 final. Yes, 7.0.M2 has its jar as 7.0.0-SNAPSHOT, we do not version them at each milestone yet.
I am sorry, look like we do not support that feature any more. However, if you want do this way you can extend the "JDBCConnector" class in the the "/extensions/connector-jdbc-{version}.jar file and override the "createIdentity" and "getConnection" methods. Once you have the updated class, this class needs to jared up and placed in the "extensions" directory and then modify the connector binding properties and update the "ConnectorClass" and "ConnectorClasspath" properties to reflect the changes.
We will update our docs. Thanks.