I have written a Java application that allows a database admin user the ability to provide a unique application ID, and associated driver, url, username, and password for the corresponding java application to connect to a oracle database. Such attributes are stored encrypted in a configuration file for security reasons. A java application retrieves the associated unencrypted connection attributes based on its unique application id. The indicated Java application works great for java Oracle related connection attributes. I have been tasked to provide the same functionality to provide Perl database connection attributes like driver dbi:driver:; url (in my case) //misrac/codb and allow a Perl application to retrieve its unencrypted attributes to connect to an Oracle database. I have written a Java Database Utility Class that handles all required Oracle database actions such as: database connection, create new account, etc. The problem is this class works for a Java Oracle database connection with provided java Oracle connection attributes. I want to write the Perl equivalent of this Java Database Utility Class such that I can call the appropriate subroutines passing the required connection arguments (Perl driver, Perl URL, username, password and in same cases other arguments) from the Java application. Issues are: 1) I do not understand from other/earlier posts how to call Perl subroutines from Java, and 2) how to provide/pass the required arguments to such Perl subroutines. As always thanks for your time and assistance.


In reply to Calling Perl with arguments From Java by rgwest61

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.