6 Replies Latest reply on May 16, 2003 7:46 AM by davidjencks

    How to set connection properties in Oracle datasource?

    severityone

      I have to do the equivalent of the following in an Oracle datasource configuration file:

      prop.put("oracle.net.encryption_client", "REQUIRED");
      prop.put("oracle.net.encryption_types_client", "(RC4_256, 3DES168)");
      prop.put("oracle.net.crypto_checksum_client", "REQUESTED");
      prop.put("oracle.net.crypto_checksum_types_client", "( MD5, SHA1 )");

      I sort of desperately need it, and I can't find it explained anywhere (not even in the paid for documentation).

      Could anyone help me with this? Thanks!

      - Peter

        • 1. Re: How to set connection properties in Oracle datasource?
          davidjencks

          Its more or less essential to clearly state what jboss version you are using if you want useful help.

          For jboss 3.2, and 4, you need to include config-property elements for each property you wish to set in your *-ds.xml file. For 3.0.7, you need to inculde a ConfigurationProperties config-property String that is a text representatoin of the Properties object you are constructing.

          • 2. Re: How to set connection properties in Oracle datasource?
            fboss

            I am using Jboss 3.0.3 (and jboss 3.0.7) and this is my database service.xml. I need to specify some additional oracle variables too. but it doesn't work if I just add my own config-property



            <config-property name="ConnectionURL" type="java.lang.String">jdbc:oracle:thin:@hello.myoracle.ca1551:sisv9</config-property>
            <!-- <config-property name="ConnectionURL" type="java.lang.String">jdbc:oracle:thin:@hello.myoracle.ca:1551:sisv9</config-property> -->
            <config-property name="DriverClass" type="java.lang.String">oracle.jdbc.driver.OracleDriver</config-property>
            <!--set these only if you want only default logins, not through JAAS -->
            <config-property name="UserName" type="java.lang.String">hey</config-property>
            <config-property name="Password" type="java.lang.String">yeahrite</config-property>


            -- doesn't work

            <config-property name="UserNamename="oracle.net.encryption_client" type="java.lang.String">REJECTED</config-property>
            <config-property name="oracle.net.crypto_checksum_client" type="java.lang.String">REJECTED</config-property>



            Does anyone know how to do this?

            • 3. Re: How to set connection properties in Oracle datasource?
              fboss

              Can anyone help me with this? I am using Jboss 3.0.6 as I've explained earlier.

              • 4. Re: How to set connection properties in Oracle datasource?
                davidjencks

                something like

                <config-propery name="ConfigurationProperties" type="java.lang.String">#this is properties file format
                oracle.net.encryption_client=REQUIRED
                oracle.net.encryption_types_client=(RC4_356, 3DES168)
                oracle.net.crypto_checksum_client=REQUESTED
                oracle.net.crypto_checksum_types_client=(MD5,SHA1)</config-property>

                is what I was talking about. These will get used in a

                getConnection(props) call with the username/pw. If this isn't what you need you need to specify more clearly what you are trying to do.

                I don't know how much before 3.0.7 this works for.

                • 5. Re: How to set connection properties in Oracle datasource?
                  fboss

                  Thanks David. I've just looked into the ra.xml in jboss-local-jdbc.rar for both 3.0.6 and 3.0.7. In 3.0.6, you can't set connectionProperties at all because it's not supported anywhere, where as in 3.0.7, connectionProperties is in the ra.xml, and there's a getConnectionProperties method, but there is no setter method "setConnectionProperites" in the LocalManagedConnectionFactory class. Correct me if I am wrong.

                  I guess since Jboss is open source, I can actually modify LocalManagedConnectionFactory to include a setter method. Should be pretty straightforward.

                  • 6. Re: How to set connection properties in Oracle datasource?
                    davidjencks

                    On line 102 of my copy of jboss 3.0 LocalManagedConnectionFactory I see a setConnectionProperties method as I described. It's ConnectionProperties rather than ConfigurationProperties, sorry about the mistake earlier.