Is retreiving a db connection from the command line possible?

I have some Java code that is part of a larger monthly data processing application that is run via scripts on AIX. In the middle of the data processing, one of the scripts calls my Java code, which reads in data from one table, does some magic on it, and outputs it to another table, which the calling script then accesses and everything goes on its merry way.
Currently, the user id, password and db url are stored in a property file that the Java app uses to make the database connection. In an effort to increase security, my team is removing all db connection information from property files such as this and creating one common script that will be executed to connect to the databases, hiding the connection info and reducing the number of locations that passwords must be updated every 90 days.
So my question is this: When running a processing script, executing this common connection script creates the db connection and database commands can be issued from the processing script. In a similar vein, is there a way for my Java app to call this common connection script and retrieve the connection object for use inside the Java app?

flyingmullet wrote:
I have some Java code that is part of a larger monthly data processing application that is run via scripts on AIX. In the middle of the data processing, one of the scripts calls my Java code, which reads in data from one table, does some magic on it, and outputs it to another table, which the calling script then accesses and everything goes on its merry way.
Currently, the user id, password and db url are stored in a property file that the Java app uses to make the database connection. In an effort to increase security, my team is removing all db connection information from property files such as this and creating one common script that will be executed to connect to the databases, hiding the connection info and reducing the number of locations that passwords must be updated every 90 days.
So my question is this: When running a processing script, executing this common connection script creates the db connection and database commands can be issued from the processing script. In a similar vein, is there a way for my Java app to call this common connection script and retrieve the connection object for use inside the Java app?No
But the script could pass the connection information to the java program as command line arguments.

Similar Messages

  • Get GPS location from the command line

    Is there a utility to get the current GPS location from the command line?  A quick search says `geo` will do it, but that appears to come with the android dev tools, which I'd rather not install right now.  The reason I want to do this is to avoid hard-coding my coordinates in a call to `redshift`.

    enduser wrote:
    Hmm.. `gpspipe` gives me:
    gpspipe: could not connect to gpsd localhost:2947, Unknown error -6(-6)
    And `gpsd` gives me:
    gpsd:ERROR: can't run with neither control socket nor devices
    Do I need to be root for these applications? Alternatively, could I maybe just grab the timezone from /etc/localtime and use that? (though I guess that doesn't get close enough on longitude...)
    You have to start gpsd from systemctl.  And you can plug/unplug gps devices at will, so it can be enabled in systemctl whether or not an actual gps is always available.

  • Is it possible to run Acrobat3D from the command line?

    I'd like to know if it is possible to run Arobat3D from the command line in batch mode. I'm interested in knowing if this is possible in either a windows or unix environment.
    My objective is to convert CAD data e.g. CATIA V5 or DXF etc to PDF, in batch mode without using the Acrobat3D interface itself.
    I know that it's possible to run a batch process from within Acrobat3D itself, therefore one solution may be to invoke those batch processes from the command line.
    I've looked through the other listings on this forum and seen this question asked previously, but I've not seen any responses that suggest this is even a feasible concept.

    As of now, it's not possible in the cmd-mode to just remain connected and not stream.
    But the reason you want to do that is because of the long start-up time. That 20 sec time can be divided into:
    1. launch time
    2. time to start encoding (after pressing start button) -> cannot be reduced even if 'connected only' feature is available in cmd-line
    Below are tips you can use to reduce this 20 sec of time:
    1. Lesser the no. of devices connected to the system, shorter is the launch time. Disable the devices which are not to be used in the session.
    2. Try using device indexes (0, 1, 2, etc) instead of device names in the profile. Indexes might change after you disable some of the devices.
    3. Use the profile with correct settings, to avoid any validation errors.
    4. Higher the video size, higher is the overall time. Small sizes take lesser time to start.
    Let me know if you see any improvement in the startup time.

  • Running powewrpc programs from the command line

    I am trying to run a powerpc application (quicken) from the command line. I want to log into the mac over my local network and run a powerpc program, but I get the following when I try it:
    cannot execute binary file
    I am logging in via ssh, and am running the X11 package from a different unix system which also runs X11.
    How do I get the application to execute? (it runs fine from the desktop).

    I am sitting at a Sun Solaris machine (it runs X11R6
    and Matif). I want to run Quicken, which is on the
    mac mini. I log into the mac with ssh -X. I find the
    Quicken program, but the permissions are set to 644
    (read, but not execute). If I change the permissions
    and try to run the program I get teh error message
    "cannot execute binary file".
    The window interface of the Mac is not X11: so you cannot output it on another X system. Is is not like connecting to another Un*x system.
    Said that, you should be able to launch a program, but you cannot see the output. However, usually Macosx applications are bundles with some executable inside, not directly an executable file: .app files are folders, not files. In order to launch such kind of apps, you have to use the open command I suggested in the previous post.
    I have no idea what VNC is. If this is how I can do
    this, then please provide me a link to it.
    VNC is a screen sharing application, just like Windows Remote Desktop. You may install a VNC server on your mac mini, and then connecting with a VNC client you will see all your computer screen as if you were there. It is cross platform, so no matter which is your client (including mobile phones).

  • Is it possible to script Firefox to do things from the command line?

    Specifically, I am attempting to print a web page at a specific url from the command line.

    Thanks for the quick reply. I had already seen the page you linked to, but it doesn't have any commands to print a web page. Should I interpret from that absence that there isn't a way to print from Firefox from the command line?

  • Is there a way to switch between workspaces in Spaces from the command line?  I want to write a script to set up certain applications in certain workspaces (without having to do it manually each time)...

    Is there a way to switch between workspaces in Spaces from the comnand line?  I use several workspaces from Spaces, each workspace having a certain number of fixed applications running.  Rather than set all this up each time I log on, I'd like to write a script from the command line (I use gawk) to automate this. Currently I have a gawk script that, given a directory, opens a few xterms whose working directory is the given directory, and opens "preview" applied to a certain file in that directory.  However, at present I have to manually move an xterm through each workspace and run my gawk script in each workspace (applied to each directory that I'm working on).
    There must be a better way...

    Addendum: Can this be done via:   open -a Spaces --args xxx  , where xxx is some set of arguments (or something like this)?

  • Help required - running a Java program from the command line

    Hi,
    I have a small non-graphical Java application, packaged into a Jar file. My program relies on classes in another (external) Jar file.
    When I run the application from the IDE, everything works fine. However, when I try to run the application from the command line, I keep getting a NoClassDefFoundError for classes in the external jar.
    Both the application jar file and the external jar file are in my root directory (C:\).
    My command line call is as follows:
    java -cp c:MyExternalLib.jar -jar MyApp.jar
    Any help greatly appreciated.
    Thanks,
    Walter

    hi,
    set classpath=%classpath%;c:\myjar.jar;
    here i have specified myjar.jar file as an example u give ur location.after setting the classpath run ur java application.
    java mypgm
    this will solve ur problem
    regards,
    Ganesh

  • Problem with running a java program from the command line

    I have this code:
    package pkg;
    import jxl.*;
    import java.io.File;
    public class TestClass {
         public static void main(String[] args) {
              try{
                   Workbook book = Workbook.getWorkbook(new File("d:/testWorkspace/excFile.xls"));
                   Sheet sheet = book.getSheet(0);
                   String s=sheet.getCell(4, 2).getContents();
                   System.out.println(s);     
              }catch (Exception e){System.err.println(e);}
    }I've wrote it in Eclipse, added jxl.jar to the buildpath, and it works fine.
    Then I tried to run it from the command line and I did it like this:
    D:\testWorkspace\testProject\bin> java -cp \jxl.jar pkg.TestClassThe result was:
    Exception in thread "main" java.lang.NoClassDefFoundError: pkg/TestClass
    Caused by: java.lang.ClassNotFoundException: pkg.TestClass
    ...but the file TestClass.class DOES exist in the folder d:\testWorkspace\testProject\bin\pkg\ and the file jxl.jar IS on the root of drive D (like I already wrote, it worked fine inside the Eclipse).
    So, my question is: How to run this code from the command line?
    I have no idea what went wrong.
    Can someone help me, please?

    The current directory is not implied in the classpath.
    D:\testWorkspace\testProject\bin> java -cp .;d:\ pkg.TestClassor
    D:\testWorkspace\testProject\bin> java -cp .;d:\jxl.jar pkg.TestClassI always forget which is right since I never work with jars...

  • Get the absolute path and filename of the file from the command line

    Hi,
    when we run the class we give the command
    java <filename>
    How can I capture the filename given above and get its absolute path inside the
    public static void main(String [] args){}
    args[0] gives me the command line argument after the filename. How do I capture the filename itself from the command line argument and also get that files absolute path
    Thanks

    I don't know of any way to capture the java command input, but there are ways to find out where the application is being run from. (the "absolute path")
    http://forum.java.sun.com/thread.jsp?forum=31&thread=335394

  • Run javascript (not in a jsx file) from the command line extendscript

    Hi all,
    I was wondering if anyone knew how to run javascript from the command line in Extendscript (meaning Extendscript would be the target application). I know about the -run command line flag in which allows you to run a .jsx script from the command line but what I'm looking for similar syntax to run a script directly without needing to put it in a file. For example I have tried (obviously unsuccessfully):
    C:\Program Files (x86)\Adobe\Adobe ExtendScript Toolkit CC\ExtendScript Toolkit.exe -run "alert('Hello World');"
    Thanks!

    You might be looking for something like this: javascript - Is it possible to execute JSX scripts from outside ExtendScript? - Stack Overflow
    Although that one is about executing JSX files, the solutions given (Applescript as well as COM/VBScript) can be adapted to simply run a javascript code snippet rather than JSX file because the solutions simply call the Adobe app's Applescript/COM API to "execute javascript" (actually execute ExtendScript technically), and in the solution, they using includes to pull in the JSX file. You'd simply replace the include with actual javascript code snippet inserted in.
    Though this would then require you to run a VBScript, Applescript, or other script (that calls the COM/Applescript API) rather than the ESTK command line option.

  • How can I print the test page with the Arabic type from the command line

    Hi,
    I have been trying to make the tool for printing the test page from the command line on the Arabic OS. I used "rundll32 printui dll printuientry" with "/k /n" options. My tool is to print the test page in all OS when pushing the
    button.
    Normally, in the Arabic Windows, the test page is printed with RTL type when printing the test page in the "Devices and Printers". But in my tool, the test page is printed with LTR type. I'm confused because of this result.
    Is it possilbe to print the test page with RTL type when using the "rundll32 printui dll printuientry"? If it is possible, could anyone give me the hint or information for resolving?
    Please check for me.

    Hello,
    Thank you for your post.
    Your issue is out of support range of Test Tools in Visual Studio 2010 and 2012 forum which discusses Visual Studio Test issues.
    I am moving your question to the moderator forum ("Where is the forum for..?"). The owner of the forum will direct you to a right forum.
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How I can set my default browser mozilla firefox from the command line in Windows 7?

    I need to set my default browser mozilla firefox from the command line, ie without using the GUI.

    '''-setDefaultBrowser''' is the correct command - you need the two capital letters.
    Why Firefox 17.0.1? You would be missing a number of important security updates. Firefox 17.0.'''9''' is the current ESR release version.

  • Problem - reading an abitrary string from the command line in basic swing

    Hi,
    I'm sorry if this problem is a bit basic, but I've only just started swing in Java. Anyway, I'm trying to adapt a basic swing version of the HelloWorld class. When I try to pass an abitrary string from the command line to the label within the class, I get the following error,
    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1
            at week2.HelloWorldSwing_commandline.main(HelloWorldSwing_commandline.java:31)
    Java Result: 1I must be missing something because I can't see where the problem is in the following code.
    import javax.swing.*;
    import java.awt.*;
    public class HelloWorldSwing_commandline {
        String message;
        private static void createAndShowGui(String message){
            JFrame.setDefaultLookAndFeelDecorated(true);
            JFrame frame = new JFrame("HelloWorldSwing");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            JLabel label = new JLabel(message);
            Container content = frame.getContentPane();
            content.add(label);
            frame.pack();
            frame.setVisible(true);
        public static void main(String[ ] args) {
         createAndShowGui(args[1]);
    }Any help would really be appreciated.

    Hi,
    I've tried changing the index value to O in the main method, but I still get the same error.
    I'm running this in NetBeans 4.1, and when I try to run the class I get the error as listed above.
    Any ideas how to correct this error?
    Thanks

  • How to burn CD's from the command line in 2009?

    I've always managed to burn CDs and DVDs from the command line but I haven't done it in a long time. cdrecord wasn't working as root and I noticed it was just a symlink pointing to wodim.
    I tried the following command as root in a directory with some wav files:
    # cdrecord -dev=/dev/sr0 -driveropts=burnfree -audio -pad *.wav
    Which gives me:
    Mar 6 08:43:18 wilco ata7.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
    Mar 6 08:43:18 wilco ata7.00: cmd a0/00:00:00:00:00/00:00:00:00:00/a0 tag 0
    Mar 6 08:43:18 wilco cdb 35 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    Mar 6 08:43:18 wilco res 40/00:02:00:0c:00/00:00:00:00:00/a0 Emask 0x4 (timeout)
    Mar 6 08:43:18 wilco ata7.00: status: { DRDY }
    Mar 6 08:43:18 wilco ata7: hard resetting link
    Mar 6 08:43:19 wilco ata7: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
    Mar 6 08:43:19 wilco ata7.00: configured for UDMA/100
    Mar 6 08:43:19 wilco ata7: EH complete
    This worked for me in 2008, so has anything big changed?

    Rasi wrote:
    Wilco wrote:
    Dieter@be wrote:I did not follow the discussion, but I just use wodim as specified on http://wiki.archlinux.org/index.php/CD_Burning_Tips, and that works great for me.
    Hmm strange, I tried the same command as in my first post and it works fine with the real cdrtools but not with wodim (I also tried k3b and that failed too). So I just stick with cdrtools
    Hooray, one more convert
    I haven't really followed the discussion either but why choose an "emulated cdrecord" that doesn't work instead of the real program that works great?

  • Compress/zip files from the command line in Windows 7?

    In Windows 7 is there a native way to compress or zip files from the command line?  I'd like to do it without installing any third-party utilities such as 7Zip.

    I fully agree that Compact is not the answer. There are additional concerns with the Compact command. It enables disk compression which is a total no-no. Very bad! It makes your computer very slow and is quite difficult to undo. The only time anyone should
    use this command is when they're removing disk compression because someone turned it on to save space.  Turning this off has to be done by booting into the recovery console, if my memory serves me correctly, and it's a real nuisance.  So
    definitely no to the Compact command.
    If you wanted to compress files before sending them to another drive, or over a network, or by email, then Compact wouldn't actually help at all because the files have to get uncompressed whenever they're accessed, especially before sending them anywhere. 
    When I say accessed, I mean that just looking at a file triggers the OS to decompress it in the background and present you with an uncompressed version of it then letting you change it and recompressing it again for storage every single time you access the
    file, which is why your machine gets slower.  If you have folders or files that have blue text instead of black, then you've probably already made this mistake.
    I would also like to know if there is a built-in command for zipping files/directories, or, if there isn't such a thing built into Windows, then I would like to know if this is feature is accessible through Visual Studio, which would be just as good as having
    a command-line program for those of us that do a bit of programming.
    If anyone knows if MS provides such a feature, either by command-line or through an API, then I'd love to hear about it.  Good luck to those of you that have disk compression turn on.

Maybe you are looking for

  • LinkButton click doesn't launch URL in the bin-release folder

    I have a project "xyz.mxml" in which I use a datagrid. The action script assigns a ItemRenderer of object LinkButtonRenderer gdColumn.itemRenderer = new ClassFactory(LinkButtonRenderer); This LinkButtonRenderer.mxml is another file in my project "xyz

  • Update rule - Routine Char -ABAP issue

    Dear Experts, Infocube u2013 Update rule u2013Chars- MM_BEMOT(Indicator)  IS a FIELD which I am introducing in the update rule. I don't get any value from Data_package. MM_BEMOT_ITAB has 2 entries.(50,06). It is not updating 2 entries u2013 It is upd

  • Network Routings not imported through "Bill and Routing Interface" program

    Hi, I wanted to import Network routing to Shop Floor Manager hence I am using bom_op_routings_interface and then I am running "Bill and Routing Interface" program. But import program is errored with "You do not have access to items of type standard,

  • Lifetime affiliate commissions is not fair!

    Hello everyone  I recently put together an affiliate program for my website www.hashems.com  I went through all the trouble of having some custom programming done so that customers can actually link to one product and not just a catalog.   So now i r

  • Explorer/Polestar Supoprt Pack Query

    Hi, I am breaking this out from a different thread I created for clarity and because I am still not clear on the answer. Basically I am trying to work out whether Polestar SP3 is available and if not is it safe/recommended/supported to install SP3 fo