本記事では CData サポート担当からこんなことを聞かれたらどこを確認すべきか?という観点で、よく頂くお問合せ内容をご紹介します。
記事はこちら →CData JDBC Drivers は標準JDBC インターフェースをサポートし、JVM 上で実行されるWeb アプリケーションに統合します。この記事では、Tomcat のConnection Pool からAzure Analysis Services に接続する方法について詳しく説明します。
To connect to Azure Analysis Services, set the Url property to a valid server, for instance, asazure://southcentralus.asazure.windows.net/server, in addition to authenticating. Optionally, set Database to distinguish which Azure database on the server to connect to.
Azure Analysis Services uses the OAuth authentication standard. OAuth requires the authenticating user to interact with Azure Analysis Services using the browser. You can connect without setting any connection properties for your user credentials. See the Help documentation for more information.
<Resource name="jdbc/aas" auth="Container" type="javax.sql.DataSource" driverClassName="cdata.jdbc.aas.AASDriver" factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" url="jdbc:aas:URL=asazure://REGION.asazure.windows.net/server;" maxActive="20" maxIdle="10" maxWait="-1" />
一つのアプリケーションからAzure Analysis Services へのアクセスを許可するには、上のコードをアプリケーションのMETA-INF ディレクトリにあるcontext.xml に追加します。
共有リソースの設定には、上のコードを$CATALINA_BASE/conf 内にあるcontext.xml に追加します。共有リソースの設定は、すべてのアプリケーションにSalesforce への接続を提供します。
Azure Analysis Services data JSP
jdbc/AAS
javax.sql.DataSource
コンテナ
Context initContext = new InitialContext();
Context envContext = (Context)initContext.lookup("java:/comp/env");
DataSource ds = (DataSource)envContext.lookup("jdbc/AAS");
Connection conn = ds.getConnection();
上記の手順では、簡単なコネクションプーリングのシナリオでAzure Analysis Services に接続する方法を説明しました。ほかの使用例や情報については、 Tomcat 製品ドキュメントの 「JNDI Datasource How-To」をご覧ください。