http://qs321.pair.com?node_id=1162900


in reply to Dazed/Confused from previous posts on how to call Java method from Perl

Get Connection Properties from database

Are your database connection properties stored in... a database? I can sort of see why you might want to keep the connection info in one place and use it from both Perl and Java. But if the Java programs connect to the database to get this info, IMO it would be easier to just have the Perl program make a DBI connection to get it as well. I admit I may not really understand the goal here.

  • Comment on Re: Dazed/Confused from previous posts on how to call Java method from Perl

Replies are listed 'Best First'.
Re^2: Dazed/Confused from previous posts on how to call Java method from Perl
by rgwest61 (Initiate) on May 13, 2016 at 14:21 UTC

    My apologies the database connection attributes (driver, url, username, password) are contained in a configuration file which is read and the associated attributes for the provided application id and retrieved and stored in the ConnectionProperties object. The Username and password values are encrypted and stored in the configuration file for security reasons. They are then decrypted before storing in the ConnectionProperties object. I still need detailed/specific code/instructions on what is needed to call the indicated class method. Thanks again for your time.

      Can you parse the config file and decrypt the credentials from the Perl program? If you absolutely need to get the connection attributes from the Java object I have to echo what Paladin said - look into Inline::Java, but I haven't done this myself.