2 Replies Latest reply on Feb 14, 2012 4:53 PM by foutjo

    How to set db2 security mechanism property using JBoss7

    foutjo

      Our db2 admin tells me that are tables are setup with the database name as the user and NO password.

       

      Using the db2 type 4 driver outside of jboss 7 I have to set the following security mechanism property.

       

      Here is the code I needed to put in my standalone test java program to make a connection using my db2

      type 4 driver:

       

                setProperty("securityMechanism", "" + com.ibm.db2.jcc.DB2BaseDataSource.USER_ONLY_SECURITY);

       

       

      Without this property getting set (standalone.xml?) I'm getting a "Security Manager" violation sql error.

       

       

      Does anyone know how I would set this property using jboss 7?

       

      I have the db2 driver setup as a module and defined in the standalone.xml.

       

      Thanks.

        • 1. Re: How to set db2 security mechanism property using JBoss7
          jbertram

          Use a <connection-property>.  From the schema:

          The connection-property element allows you to pass in arbitrary connection properties to the Driver.connect(url, props) method. Each connection-property specifies a string name/value pair with the property name coming from the name attribute and the value coming from the element content. Ex: <connection-property name="char.encoding">UTF-8</connection-property>

          • 2. Re: How to set db2 security mechanism property using JBoss7
            foutjo

            Justin you are the man!!!

             

            Added the following to the standalone.xml and I am able to connect to the database.

             

            <connection-property name="securityMechanism">
                                4
                            </connection-property>

             

            Thanks.