2 Replies Latest reply on Apr 9, 2012 11:39 AM by julianc

    Database beyond socks proxy

    julianc

      Hi,

      I'm trying to migrate my database update scripts to Camel. The legacy scripts are socksified perl scripts. The database sits in our internet DMZ beyond a socks proxy.

       

      I can use a java sql CLI (like the ones in Derby or H2) using:

       

      java -DsocksProxyHost=

       

      I just can't work out how to make this work with Camel.

       

      My junit integration tests work fine with an embedded database, its only when i point them at the real database that they fail with a communications link failure.

       

      Printing out the value of System.getProperties().getProperty("socksProxyHost") gives me a null wherever I put the print statement.

       

      I've tried putting the properties in a properties file and referencing it with a spring propertyplaceholder.

       

      How do I do this?

        • 1. Re: Database beyond socks proxy
          julianc

          Solved for Mysql.

           

          Mysql supports a socketFactory configuration property. I cloned the default and added proxy capabilities to it. Then the following worked in my applicationContext.xml:

           

           

                            <entry key="socksProxyHost" value="$" />

                            <entry key="socksProxyPort" value="$" />

                       </map>

             </property>

          </bean>

           

          A more general solution for any database would be nice.

           

          Julian

          • 2. Re: Database beyond socks proxy
            julianc

            I raised this MySql bug as a result. My factory code is attached to the bug.

             

            Julian