Tuesday, July 26, 2016

.NET Oracle Client

Method 1: Web.config
<configuration>
  <configSections>
    <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null"/>
    <section name="oracle.dataaccess.client" type="System.Data.Common.DbProviderConfigurationHandler, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
    <section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
  </configSections>
  <dataConfiguration defaultDatabase="DefaultDatabase">
    <providerMappings>
      <add databaseType="Microsoft.Practices.EnterpriseLibrary.Data.DDTekOracle.OracleDatabase, Microsoft.Practices.EnterpriseLibrary.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" name="DDTek.Oracle"/>
      <add databaseType="Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase, Microsoft.Practices.EnterpriseLibrary.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" name="Oracle.DataAccess.Client" />
    </providerMappings>
  </dataConfiguration>
  <connectionStrings>
    <add name="ConnectionString1" providerName="Oracle.DataAccess.Client" connectionString="User Id=;Password=;Data Source=; Pooling=true; Min Pool Size=1; Max Pool Size=50; Incr Pool Size=10; Decr Pool Size=10; Connection Timeout=50; Validate Connection=true;"/>
  </connectionStrings>
</configuration>

Method 2: Web.config
<connectionStrings>
    <add name="ConnectionString1" providerName="Oracle.ManagedDataAccess.Client" connectionString="User Id=;Password=;Data Source=; Pooling=true; Min Pool Size=1; Max Pool Size=50; Incr Pool Size=10; Decr Pool Size=10; Connection Timeout=50; Validate Connection=true;"/>
  </connectionStrings>
<system.data>
    <DbProviderFactories>
      <remove invariant="Oracle.ManagedDataAccess.Client" />
      <remove invariant="Oracle.DataAccess.Client" />
      <add name="Oracle Data Provider for .NET"
           invariant="Oracle.DataAccess.Client"
           description="Oracle Data Provider for .NET"
           type="Oracle.DataAccess.Client.OracleClientFactory, Oracle.DataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
      <add name="ODP.NET, Managed Driver"
           invariant="Oracle.ManagedDataAccess.Client"
           description="Oracle Data Provider for .NET, Managed Driver"
           type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
    </DbProviderFactories>
  </system.data>

Method 3: Machine.config
<system.data>
    <DbProviderFactories>
    <add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver" type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
    </DbProviderFactories>   
</system.data>

Sunday, July 24, 2016

Issue: Unable to fetch transient dependency com.google.http-client:google-http-client:[1.19.0,2.0)

Issue:

Unable to fetch transient dependency com.google.http-client:google-http-client:[1.19.0,2.0)

Solution

<dependency>
        <groupId>com.google.appengine.tools</groupId>
        <artifactId>appengine-gcs-client</artifactId>
        <version>0.6</version>
        <exclusions>
            <exclusion>
                <!-- TODO remove me after the issue is fixed https://github.com/google/google-http-java-client/issues/330 -->
                <groupId>com.google.http-client</groupId>
                <artifactId>google-http-client</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

    <!-- Add the transitive dependency explicity  -->
    <dependency>
        <groupId>com.google.http-client</groupId>
        <artifactId>google-http-client</artifactId>
        <version>1.22.0</version>
    </dependency>

Wednesday, July 6, 2016

Bootstrap Carousel

http://www.tutorialrepublic.com/codelab.php?topic=bootstrap&file=carousel
https://bootstrapbay.com/blog/bootstrap-3-carousel-tutorial/

GAE URLFetchService, JDOM2, Amazon ItemSearch, Bytes Array to String

https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/appengine/urlfetch
http://docs.aws.amazon.com/AWSECommerceService/latest/DG/ItemSearch.html
http://stackoverflow.com/questions/4661680/how-to-read-fetch-the-xml-file-from-an-url-using-java
http://stackoverflow.com/posts/4661726/revisions
http://www.tutorialspoint.com/java_xml/java_jdom_query_document.htm
http://www.studytrails.com/java/xml/jdom2/java-xml-jdom2-xpath.jsp
http://www.tutorialspoint.com/java_xml/java_jdom_parse_document.htm
https://ikaisays.com/2010/06/29/using-asynchronous-urlfetch-on-java-app-engine/
byte[] bytes = example.getBytes();
String decoded = new String(bytes, "UTF-8");