1 Reply Latest reply on Aug 7, 2014 3:05 PM by rp0428

    How to create xml connection file from an text file ?

    fmsilva2

      Hello to all !

       

          I have na text file with about 200 connections, how can i import this connections to sql developer ?

       

      Thanks

      Fernando

        • 1. Re: How to create xml connection file from an text file ?
              I have na text file with about 200 connections, how can i import this connections to sql developer ?

          As far as I know you can't.

           

          Are you talking about a TNSNAMES.ORA file with OCI client connections?

           

          The only thing I can suggest is to create appropriate XML entries for each connection and then add them to the 'connections.xml' file that sql developer uses to store those entries.

           

          1. Create a sample TNS connection in sql developer.

          2. Examine the entry for that connection in the 'connections.xml' file

          3. Create and format similar entries for the names/data in your 'text file'

          4. Add those entries to the 'connections.xml' file

           

          It will probably be easier to just manually copy/clone an existing xml file entry in an editor and manually change the name/port/etc that to try to write code to do that.

           

          A sample entry (this one is for a BASIC -thin connection) will start like this:

             <Reference name="scott" className="oracle.jdeveloper.db.adapter.DatabaseProvider" xmlns="">

                <Factory className="oracle.jdevimpl.db.adapter.DatabaseProviderFactory1212"/>

                <RefAddresses>

                   <StringRefAddr addrType="OracleConnectionType">

                      <Contents>BASIC</Contents>

                   </StringRefAddr>

                   <StringRefAddr addrType="oraDriverType">

                      <Contents>thin</Contents>

                   </StringRefAddr>

                   <StringRefAddr addrType="port">

                      <Contents>1521</Contents>

                   </StringRefAddr>

                   <StringRefAddr addrType="user">

                      <Contents>scott</Contents>

                   </StringRefAddr>

          . . .

          There are more 'StringRefAddr' entries. You can see the ones above for OracleConnectionType, oraDriverType, port and user.